-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile.template
38 lines (34 loc) · 1.04 KB
/
Dockerfile.template
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
FROM node:14.17.1-alpine3.13 AS build
WORKDIR /usr/src/nuxt-app
ENV FSXA_API_KEY=...
ENV FSXA_CAAS=...
ENV FSXA_PROJECT_ID=...
ENV FSXA_NAVIGATION_SERVICE=...
ENV FSXA_MODE=...
ENV FSXA_TENANT_ID=...
ENV FSXA_SNAP_URL=...
COPY package*.json ./
RUN npm ci --no-optional
COPY . .
RUN npx nuxt build --config-file nuxt.config.ts --standalone \
&& rm -rf node_modules && \
NODE_ENV=production npm ci --production --silent --no-optional \
&& NODE_ENV=production npm install --no-optional [email protected]
FROM node:14.17.1-alpine3.13 AS runtime
WORKDIR /usr/src/nuxt-app
RUN apk add --no-cache dumb-init=1.2.5-r0
COPY --chown=node:node --from=build /usr/src/nuxt-app /usr/src/nuxt-app
USER node
EXPOSE 3000
ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
ENV FSXA_API_KEY=...
ENV FSXA_CAAS=...
ENV FSXA_PROJECT_ID=...
ENV FSXA_NAVIGATION_SERVICE=...
ENV FSXA_MODE=...
ENV FSXA_TENANT_ID=...
ENV FSXA_SNAP_URL=...
ENV NODE_ENV=production
ENTRYPOINT ["dumb-init", "--"]
CMD [ "node", "--max-old-space-size=200", "/usr/src/nuxt-app/node_modules/.bin/nuxt-start" ]