forked from WordPress/openverse-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (26 loc) · 808 Bytes
/
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
FROM node:16-alpine
RUN npm install -g pnpm [email protected]
USER node
WORKDIR /home/node/app
COPY --chown=node:node pnpm-lock.yaml .
# install dependencies including local development tools
RUN pnpm fetch
# copy the rest of the content
COPY --chown=node:node . /home/node/app
RUN pnpm install -r --offline
# disable telemetry when building the app
ENV NUXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
ARG API_URL
ARG RELEASE
RUN echo "{\"release\":\"${RELEASE}\"}" > /home/node/app/src/static/version.json
RUN pnpm i18n
RUN pnpm build:only
COPY ecosystem.config.js /home/node/app/ecosystem.config.js
# set app serving to permissive / assigned
ENV NUXT_HOST=0.0.0.0
# set application port
ENV PORT=8443
# expose port 8443 by default
EXPOSE 8443
CMD ["pm2-runtime", "start", "ecosystem.config.js"]