-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (49 loc) · 1.65 KB
/
Dockerfile
File metadata and controls
63 lines (49 loc) · 1.65 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
### STAGE 1: Build ###
FROM node:22-alpine AS build
# Install build dependencies
RUN apk add --no-cache python3 make g++
WORKDIR /app
# Copy package files
COPY package.json yarn.lock ./
# Install dependencies
RUN yarn install --frozen-lockfile
# Copy source files
COPY . .
# Build the web application with production defaults
# Runtime environment variables will be injected at startup via docker-entrypoint.sh
# APP_ENV=production ensures the build uses production defaults and no .env suffix on IDs
RUN APP_ENV=production yarn web:build
### STAGE 2: Run ###
FROM nginx:1.25-alpine
# Install sed for the entrypoint script
RUN apk add --no-cache sed
# Copy nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built web app from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy entrypoint script
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Expose port 80
EXPOSE 80
# Set default environment variables
ENV APP_ENV=production \
UNIT_NAME="Resgrid Unit" \
UNIT_SCHEME="ResgridUnit" \
UNIT_BUNDLE_ID="com.resgrid.unit" \
UNIT_PACKAGE="com.resgrid.unit" \
UNIT_VERSION="0.0.1" \
UNIT_BASE_API_URL="https://api.resgrid.com" \
UNIT_API_VERSION="v4" \
UNIT_RESGRID_API_URL="/api/v4" \
UNIT_CHANNEL_HUB_NAME="eventingHub" \
UNIT_REALTIME_GEO_HUB_NAME="geolocationHub" \
UNIT_LOGGING_KEY="" \
UNIT_APP_KEY="" \
UNIT_MAPBOX_PUBKEY="" \
UNIT_SENTRY_DSN="" \
UNIT_COUNTLY_APP_KEY="" \
UNIT_COUNTLY_SERVER_URL=""
# Use entrypoint to inject environment variables at runtime
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]