File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change
1
+ # latest supported node version when this Dockerfile was written
2
+ ARG NODE_VERSION=22.12.0-alpine
3
+ ARG APP_DIR=/usr/src/parse
4
+
1
5
# Builder stage
2
- FROM node:22.12.0-alpine AS builder
6
+ FROM node:${NODE_VERSION} AS builder
3
7
4
- WORKDIR /usr/src/parse
8
+ WORKDIR ${APP_DIR}
5
9
6
10
COPY package*.json .
7
11
@@ -11,20 +15,17 @@ COPY . .
11
15
12
16
RUN npm run build
13
17
14
- # latest supported node version when this Dockerfile was written
15
- FROM node:22.12.0-alpine
18
+ FROM node:${NODE_VERSION}
16
19
17
- WORKDIR /usr/src/parse
20
+ WORKDIR ${APP_DIR}
18
21
19
22
# Copy only the required files from the builder stage
20
- COPY --from=builder /usr/src/parse /node_modules ./node_modules
21
- COPY --from=builder /usr/src/parse/ dist ./dist
22
- COPY --from=builder /usr/src/parse /public ./public
23
+ COPY --from=builder ${APP_DIR} /node_modules ./node_modules
24
+ COPY --from=builder ${APP_DIR}/ dist ./
25
+ COPY --from=builder ${APP_DIR} /public ./public
23
26
24
- ENV APP_ID=setYourAppId
25
- ENV MASTER_KEY=setYourMasterKey
26
- ENV DATABASE_URI=setMongoDBURI
27
+ VOLUME ["${APP_DIR}/cloud" , "${APP_DIR}/logs" ]
27
28
28
29
EXPOSE 1337
29
30
30
- CMD ["node" , "dist/ index.js" ]
31
+ CMD ["node" , "index.js" ]
You can’t perform that action at this time.
0 commit comments