feat: Update docker-compose and Dockerfile for frontend build configuration

- Added build context and Dockerfile specification for the frontend service in docker-compose.yml.
- Refactored Dockerfile.app to ensure non-root user creation is idempotent and streamlined the ownership setup for application directories.
This commit is contained in:
wizardchen
2025-11-13 20:16:15 +08:00
parent ffd5cd2881
commit 9b7128d69d
2 changed files with 4 additions and 10 deletions
+3
View File
@@ -113,6 +113,9 @@ services:
frontend:
image: wechatopenai/weknora-ui:latest
build:
context: .
dockerfile: frontend/Dockerfile
container_name: WeKnora-frontend
ports:
- "${FRONTEND_PORT:-80}:80"
+1 -10
View File
@@ -64,16 +64,7 @@ RUN if [ -n "$APK_MIRROR_ARG" ]; then \
# Create a non-root user and switch to it
RUN mkdir -p /data/files && \
adduser -D -g '' appuser && \
chown -R appuser:appuser /app /data/files
# Copy migrate tool from builder stage
COPY --from=builder /go/bin/migrate /usr/local/bin/
COPY --from=builder /app/yanyiwu/ /go/pkg/mod/github.com/yanyiwu/
# Create a non-root user and switch to it
RUN mkdir -p /data/files && \
adduser -D -g '' appuser && \
id -u appuser >/dev/null 2>&1 || adduser -D -g '' appuser && \
chown -R appuser:appuser /app /data/files
# Copy migrate tool from builder stage