forked from tcgdex/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 720 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
37
38
39
40
# This Dockerfile allows you to run Astro in a static container (no server side)
#########
# Build #
#########
FROM docker.io/node:20-alpine as BUILD_IMAGE
# run as non root user
USER node
# go to user repository
WORKDIR /home/node
# Add package json
ADD --chown=node:node package.json package-lock.json ./
# install dependencies from package lock
RUN npm ci
# Add project files
ADD --chown=node:node . .
# build
RUN npm run build
##############
# Production #
##############
FROM docker.io/nginx:1-alpine
# go to NGINX folder
WORKDIR /usr/share/nginx/html
# Copy the nginx config
ADD ./nginx.conf /etc/nginx/nginx.conf
# Copy dist fro mthe build image
COPY --from=BUILD_IMAGE /home/node/dist ./
EXPOSE 3000