feat: simplify appflowy web docker setup

This commit is contained in:
khorshuheng 2025-04-16 11:17:19 +08:00
parent 9ea3c46c26
commit 30c296398a
5 changed files with 2 additions and 23 deletions

View file

@ -85,5 +85,5 @@ jobs:
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ env.IMAGE_NAME }}:latest
images: ${{ env.IMAGE_NAME }}:latest-linux-amd64,${{ env.IMAGE_NAME }}:latest-linux-arm64
tags: ${{ env.IMAGE_NAME }}:latest-linux-amd64,${{ env.IMAGE_NAME }}:latest-linux-arm64
push: true

View file

@ -6,9 +6,6 @@
FQDN=localhost
# Change this to https if you wish to enable TLS.
SCHEME=http
# If this has changed, AppFlowy Web might still use the old value due to Javascript cache.
# If AppFlowy Web is sending requests to the wrong URL, do a hard reload on the browser,
# and/or purge Cloudflare cache if you are using CloudFlare.
APPFLOWY_BASE_URL=${SCHEME}://${FQDN}
# PostgreSQL Settings

View file

@ -216,9 +216,6 @@ services:
image: appflowyinc/appflowy_web:${APPFLOWY_WEB_VERSION:-latest}
depends_on:
- appflowy_cloud
environment:
- AF_BASE_URL=${APPFLOWY_BASE_URL:?err}
- AF_GOTRUE_URL=${API_EXTERNAL_URL}
volumes:
postgres_data:
minio_data:

View file

@ -8,12 +8,9 @@ ARG VERSION=main
RUN npm install -g pnpm@8.5.0
RUN git clone --depth 1 --branch ${VERSION} https://github.com/AppFlowy-IO/AppFlowy-Web.git .
RUN pnpm install
ENV AF_BASE_URL=AF_BASE_URL_PLACEHOLDER
ENV AF_GOTRUE_URL=AF_GOTRUE_URL_PLACEHOLDER
RUN sed -i 's|https://test.appflowy.cloud||g' src/components/main/app.hooks.ts
RUN pnpm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/nginx.conf
COPY env.sh /docker-entrypoint.d/env.sh
RUN chmod +x /docker-entrypoint.d/env.sh

View file

@ -1,12 +0,0 @@
#!bin/sh
STATIC_JS_FILE_PATH="/usr/share/nginx/html/static/js"
if [ -z "${AF_BASE_URL}" ]; then
echo "Error: AF_BASE_URL is not set."
exit 1
fi
if [ -z "${AF_GOTRUE_URL}" ]; then
echo "Error: AF_BASE_URL is not set."
exit 1
fi
find ${STATIC_JS_FILE_PATH} -type f -exec sed -i "s|AF_BASE_URL_PLACEHOLDER|$AF_BASE_URL|g" {} +
find ${STATIC_JS_FILE_PATH} -type f -exec sed -i "s|AF_GOTRUE_URL_PLACEHOLDER|$AF_GOTRUE_URL|g" {} +