-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 839 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 839 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
# prereq: first do `yarn build` to compile typescript & etc.
FROM node:20-alpine
WORKDIR /usr/src/app
# Install PM2 globally
# RUN yarn global add pm2
# Fet dependencies in for efficient docker layering
COPY dist/package.json dist/yarn.lock ./
# Clean yarn cache to reduce image size
RUN yarn install --frozen-lockfile --production && \
yarn cache clean --force && \
rm -rf /usr/local/share/.cache/yarn
# Show installed packages
RUN npm list || true
# Copy over typescript payload
COPY dist ./
# Copy the PM2 ecosystem configuration
# COPY ecosystem.config.js ./
#ENV PORT=80
#EXPOSE 80/tcp
# EXPOSE 8090/tcp
# EXPOSE 8091/tcp
# EXPOSE 8092/tcp
# Use PM2 to run the application with the ecosystem config (was only for VM, not cloud run)
#CMD ["pm2-runtime", "ecosystem.config.js"]
CMD ["node", "backend/api/lib/serve.js"]