-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.local
More file actions
40 lines (30 loc) · 1.22 KB
/
Dockerfile.local
File metadata and controls
40 lines (30 loc) · 1.22 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
# AccountSafe Frontend Dockerfile - Local Development (No SSL)
# Multi-stage build: Build with Node, Serve with Nginx
# ===== Stage 1: Build =====
FROM node:18-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci --silent
COPY . .
# React env vars must be present at build time (CRA inlines them)
ARG REACT_APP_API_URL=http://localhost/api/
ARG REACT_APP_PROJECT_NAME=AccountSafe
ARG REACT_APP_LOGO_URL=/account-safe-logo.png
ARG REACT_APP_TURNSTILE_SITE_KEY=1x00000000000000000000AA
ENV REACT_APP_API_URL=$REACT_APP_API_URL
ENV REACT_APP_PROJECT_NAME=$REACT_APP_PROJECT_NAME
ENV REACT_APP_LOGO_URL=$REACT_APP_LOGO_URL
ENV REACT_APP_TURNSTILE_SITE_KEY=$REACT_APP_TURNSTILE_SITE_KEY
RUN npm run build
# ===== Stage 2: Production (No SSL) =====
FROM nginx:alpine
# Remove default nginx config
RUN rm /etc/nginx/conf.d/default.conf
# Copy local nginx configuration (no SSL)
COPY nginx.local.conf /etc/nginx/conf.d/default.conf
# Copy built assets from builder stage
COPY --from=builder /app/build /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1
CMD ["nginx", "-g", "daemon off;"]