-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (27 loc) · 803 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
# see https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
ARG NODE_VERSION=node:16.16.0
FROM $NODE_VERSION AS dependency-base
# create destination directory
RUN mkdir -p /app
WORKDIR /app
# copy the app, note .dockerignore
COPY package.json .
COPY package-lock.json .
RUN npm ci
FROM dependency-base AS production-base
# build will also take care of building
# if necessary
COPY . .
RUN npm run build
FROM $NODE_VERSION AS production
COPY --from=production-base /app/.output /app/.output
# Service hostname
ENV NUXT_HOST=0.0.0.0
# Service version
ARG NUXT_APP_VERSION
ENV NUXT_APP_VERSION=${NUXT_APP_VERSION}
ENV DATABASE_URL=file:./db.sqlite
# Run in production mode
ENV NODE_ENV=production
# start the app
CMD [ "node", "/app/.output/server/index.mjs" ]