-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.web
More file actions
43 lines (34 loc) · 1.54 KB
/
Copy pathDockerfile.web
File metadata and controls
43 lines (34 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# syntax=docker/dockerfile:1
# Stage 1: Build Flutter web
# The base image holds the Flutter SDK, the web artifacts and a warm pub cache
# (Dockerfile.web-base, published by .github/workflows/web-base-image.yml).
# Bump FLUTTER_VERSION here only; the workflow builds the matching base tag.
ARG FLUTTER_VERSION=3.47.0
FROM ghcr.io/chuk-development/chuk-chat-web-base:${FLUTTER_VERSION} AS build
WORKDIR /app
COPY pubspec.yaml pubspec.lock ./
COPY vendor/ ./vendor/
# Path dependencies (flutter_rfb, dart_rfb) must be present before pub get.
COPY third_party/ ./third_party/
# PUB_CACHE in the base image is already warm: only changed packages download.
RUN flutter pub get
COPY . .
ARG SUPABASE_URL
ARG SUPABASE_ANON_KEY
ARG BUILD_TIMESTAMP=""
# Generate web environment config (dart-define can be unreliable with dart2js)
RUN echo "// GENERATED - DO NOT EDIT" > lib/web_env.dart && \
echo "const String webSupabaseUrl = '${SUPABASE_URL}';" >> lib/web_env.dart && \
echo "const String webSupabaseAnonKey = '${SUPABASE_ANON_KEY}';" >> lib/web_env.dart
# FEATURE_PROJECTS and FEATURE_IMAGE_GEN were removed: nothing in lib/ reads
# them. --no-wasm-dry-run skips a compatibility scan this build does not use.
RUN flutter build web --release \
--no-wasm-dry-run \
--dart-define=BUILD_TIMESTAMP="${BUILD_TIMESTAMP}" \
--dart-define=FEATURE_VOICE_MODE=false
# Stage 2: Serve with nginx
FROM nginx:alpine
COPY --from=build /app/build/web /usr/share/nginx/html
COPY nginx.web.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]