-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
36 lines (25 loc) · 906 Bytes
/
Dockerfile.frontend
File metadata and controls
36 lines (25 loc) · 906 Bytes
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
# VaultStadio Frontend - Compose Multiplatform for Web
# Multi-stage build
# Stage 1: Build
FROM gradle:9.3-jdk17 AS builder
WORKDIR /app
# Copy Gradle files first for caching
COPY settings.gradle.kts build.gradle.kts gradle.properties ./
COPY gradle ./gradle
# Copy source code
COPY compose-frontend ./compose-frontend
COPY shared ./shared
# Build the web application
RUN gradle :compose-frontend:composeApp:wasmJsBrowserDistribution --no-daemon
# Stage 2: Serve with Nginx
FROM nginx:alpine
# Copy built web app
COPY --from=builder /app/compose-frontend/composeApp/build/dist/wasmJs/productionExecutable /usr/share/nginx/html
# Custom nginx config
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]