-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
33 lines (25 loc) · 1.02 KB
/
Dockerfile.prod
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
# =============================================================================
# Build phase
# =============================================================================
# Use a Node.js image
FROM node:latest AS builder
# Set the working directory
WORKDIR /app
# Copy the package.json and package-lock.json files
COPY package*.json yarn.lock ./
# Install dependencies
RUN yarn install
# Copy everything to the container
COPY . .
# Generate build files
RUN yarn build:prod
# =============================================================================
# Production Phase
# =============================================================================
# We specifify the platform because of compatibility issues when Mac Chips
# More info: https://stackoverflow.com/questions/74705475/aws-ecs-exec-usr-local-bin-docker-entrypoint-sh-exec-format-error
FROM --platform=linux/amd64 nginx:latest
COPY --from=builder /app/build /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]