-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
40 lines (33 loc) · 1.05 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
# develop stage
# FROM node:18 AS build
# FROM node:latest AS build
FROM node:20 AS build
# FROM node:18-alpine as build
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init
WORKDIR /app
COPY package*.json /app
RUN npm install @quasar/cli -g
RUN npm install
# RUN npm ci --only=production
COPY . /app
# FROM build as local-deps-stage
RUN quasar build -m ssr
# FROM node:18-bullseye-slim
FROM node:20-alpine
ENV TZ=Asia/Bangkok
RUN apk add --no-cache tzdata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezon
RUN npm install pm2 -g
ENV NODE_ENV production
# COPY --from=build /usr/bin/dumb-init /usr/bin/dumb-init
USER node
WORKDIR /app
COPY --chown=node:node --from=build /app/node_modules /app/node_modules
COPY --chown=node:node --from=build /app/dist/ssr /app
COPY --chown=node:node --from=build /app/ecosystem.config.cjs /app
# CMD ["pm2-runtime", "index.js"]
CMD ["pm2-runtime", "ecosystem.config.cjs"]
# CMD ["dumb-init", "node", "index.js"]
# dev stage
# FROM local-deps-stage as dev-stage
# RUN quasar dev -m ssr