첫 커밋: 로컬 프로젝트 업로드
This commit is contained in:
38
baron-sso/userfront/Dockerfile
Normal file
38
baron-sso/userfront/Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
FROM ghcr.io/cirruslabs/flutter:3.38.0 AS dev
|
||||
ENV RUN_FLUTTER_AS_ROOT=true
|
||||
WORKDIR /workspace
|
||||
COPY scripts ./scripts
|
||||
COPY locales ./locales
|
||||
COPY userfront ./userfront
|
||||
WORKDIR /workspace/userfront
|
||||
RUN flutter pub get
|
||||
EXPOSE 5000
|
||||
CMD ["sh", "./scripts/dev-server.sh"]
|
||||
|
||||
# Stage 1: Build Flutter
|
||||
FROM ghcr.io/cirruslabs/flutter:3.38.0 AS build
|
||||
ENV RUN_FLUTTER_AS_ROOT=true
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
# Get dependencies and build for web
|
||||
RUN /bin/sh ./scripts/sync_userfront_locales.sh
|
||||
WORKDIR /app/userfront
|
||||
RUN flutter pub get
|
||||
RUN rm -rf build/web && flutter build web --release --wasm
|
||||
|
||||
FROM node:24-alpine AS optimize
|
||||
WORKDIR /work
|
||||
COPY --from=build /app/userfront/build/web /work/build/web
|
||||
COPY userfront/scripts/optimize-web-build.mjs /work/scripts/optimize-web-build.mjs
|
||||
RUN node /work/scripts/optimize-web-build.mjs /work/build/web
|
||||
|
||||
# Stage 2: Serve with Nginx
|
||||
FROM alpine:3.23 AS production
|
||||
RUN apk add --no-cache nginx nginx-mod-http-brotli
|
||||
# Copy built assets
|
||||
COPY --from=optimize /work/build/web /usr/share/nginx/html
|
||||
# Copy custom Nginx config
|
||||
COPY userfront/nginx.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
EXPOSE 5000
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user