Merge pull request #237 from AppFlowy-IO/doc/ec2-setup

Doc/ec2 setup
This commit is contained in:
Zack 2023-12-27 15:32:51 +08:00 committed by GitHub
commit 34f69ab3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 39 deletions

View File

@ -18,6 +18,29 @@ env:
LATEST_TAG: latest
jobs:
gotrue_image:
runs-on: ubuntu-22.04
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push GoTrue
run: |
export TAG=${GITHUB_REF#refs/*/}
docker buildx build --platform linux/amd64,linux/arm64 -t appflowyinc/gotrue:${TAG} -t appflowyinc/gotrue:latest -f docker/gotrue.Dockerfile --push .
appflowy_cloud_image:
runs-on: ubuntu-22.04
env:
@ -49,7 +72,7 @@ jobs:
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Extract metadata
id: meta
@ -92,7 +115,7 @@ jobs:
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Create and push manifest for ${{ matrix.job.image_name }}:version
uses: Noelware/docker-manifest-action@master
@ -143,7 +166,7 @@ jobs:
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Extract metadata
id: meta
@ -187,7 +210,7 @@ jobs:
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Create and push manifest for ${{ matrix.job.image_name }}:version
uses: Noelware/docker-manifest-action@master
@ -205,4 +228,4 @@ jobs:
- name: Logout from Docker Hub
if: always()
run: docker logout
run: docker logout

View File

@ -26,6 +26,7 @@ GOTRUE_ADMIN_PASSWORD=password
# change this to your own domain where you host the docker-compose or gotrue
API_EXTERNAL_URL=http://your-host
# Refer to this for details: https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/main/doc/AUTHENTICATION.md
# Google OAuth2
GOTRUE_EXTERNAL_GOOGLE_ENABLED=true
GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=

View File

@ -25,6 +25,7 @@ For example, I create a project that used for localhost development. After creat
![create_credentials.png](../assets/images/create_google_credentials.png)
Under 'Application type*', select 'Web application'.
The redirect URI should be `<your host server public ip/hostname>/gotrue/callback`. For example, my host server is `localhost`, so the redirect URI is `http://localhost/gotrue/callback`.
![create_client.png](../assets/images/create_google_oauth_client_id.png)

View File

@ -17,47 +17,27 @@ If you have any questions, please feel free to reach out to us on [Discord](http
- In "Key pair (login)," select an existing key pair or create a new one.
- Review and launch the instance from the Summary panel.
## Installing Docker on Your EC2 Ubuntu Instance
## Installing Docker Compose on Your EC2 Ubuntu Instance
1. **Update Packages**:
1. **Follow the official guide for docker installation on Ubuntu: [docker install guide](https://docs.docker.com/engine/install/ubuntu/#installation-methods)**
2. **After it's installed, verify the installation**
```bash
sudo apt update
docker compose version
# Docker Compose version v2.21.0
```
2. **Install Prerequisites**:
3. **Ensure that the docker daemon is running**
```bash
sudo apt install apt-transport-https ca-certificates curl software-properties-common
sudo systemctl enable --now docker
```
3. **Add Docker's Official GPG Key**:
```bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
```
4. **Add Docker Repository**:
```bash
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
```
5. **Update Package Database with Docker Packages**:
```bash
sudo apt update
```
6. **Install Docker**:
```bash
sudo apt install docker-ce
```
7. **Check Docker Status**:
```bash
sudo systemctl status docker
```
8. **Add User to Docker Group** (optional, to run Docker commands without `sudo`):
4. **Add current user to Docker Group (optional, to run Docker commands without `sudo`)**
```bash
sudo usermod -aG docker ${USER}
sudo systemctl restart docker
```
- Logout(exit/Ctrl-D) and log back in to take effect.
## Installing AppFlowy-Cloud
@ -81,14 +61,18 @@ If you have any questions, please feel free to reach out to us on [Discord](http
![img.png](../assets/images/google_callback_url.png)
For detailed setup instructions, refer to the Authentication documentation.
By default, no authentication is needed to sign in.
4. **Start AppFlowy Services**:
4. **Authentication Setup**:
Configure `docker-compose.yml` by removing unneeded services such as `tunnel` (cloudflare tunnel). More details: [here](https://github.com/AppFlowy-IO/AppFlowy-Cloud/blob/main/doc/DEPLOYMENT.md#3-optional-services)
5. **Start AppFlowy Services**:
Launch the services using Docker Compose:
```bash
docker-compose up -d
docker compose up -d
```
5. **Verify Service Status**:
6. **Verify Service Status**:
Check that all services are running:
```bash
docker ps -a

View File

@ -55,6 +55,7 @@ services:
build:
context: .
dockerfile: docker/gotrue.Dockerfile
image: appflowyinc/gotrue:${GOTRUE_VERSION:-latest}
depends_on:
- postgres
environment: