-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
51 lines (32 loc) · 1.58 KB
/
Dockerfile
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
#-----------------------------------------------------------------------------------------------------------------------
# Bundle Stage - Do all our bundling of assets
#-----------------------------------------------------------------------------------------------------------------------
FROM node:22 as bundle-builder
RUN mkdir -p /app
WORKDIR /app
ADD . /app/
RUN npm ci --no-fund
RUN npm run build
#-----------------------------------------------------------------------------------------------------------------------
# NPM Stage - Install production packages and clean cache
#-----------------------------------------------------------------------------------------------------------------------
FROM node:22-alpine as npm-builder
COPY --from=bundle-builder /app /app
WORKDIR /app
RUN npm ci --no-fund --omit=dev
#-----------------------------------------------------------------------------------------------------------------------
# Final Docker
#-----------------------------------------------------------------------------------------------------------------------
FROM node:22-alpine
EXPOSE 5678
MAINTAINER Christopher S. Case <[email protected]>
# Only copy the files we actually need
COPY --from=bundle-builder /app/dist /app/dist
COPY --from=npm-builder /app/node_modules /app/node_modules
COPY --from=bundle-builder /app/package.json /app/
RUN mkdir /app/db
WORKDIR /app
ADD config/ /app/config/
VOLUME /app/db
CMD [ "npm", "start", "# rpgkeeper" ]
#-----------------------------------------------------------------------------------------------------------------------