Merge pull request #1342 from AppFlowy-IO/simplify-appflowy-web-docker

feat: simplify appflowy web docker setup
This commit is contained in:
Khor Shu Heng 2025-04-16 11:24:27 +08:00 committed by GitHub
commit b0cd3c4d51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 22 deletions

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" {} +