-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
41 lines (32 loc) · 1.25 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
41
# Verificar essa issue antes de migrar para Yarn.
# https://github.com/yarnpkg/yarn/issues/77
FROM node:lts-alpine as dependencies
WORKDIR /site
COPY package.json package-lock.json ./
RUN apk add --no-cache libc6-compat
RUN npm ci --omit=dev --omit=optional --ignore-scripts --prefer-offline
FROM node:lts-alpine as builder
WORKDIR /site
COPY . .
COPY --from=dependencies /site/node_modules ./node_modules
RUN npm run build
FROM node:lts-alpine as runner
WORKDIR /site
COPY --from=builder /site/next.config.js /site/package.json ./
COPY --from=builder /site/public ./public
COPY --from=builder /site/.next ./.next
COPY --from=dependencies /site/node_modules ./node_modules
# The production environment overrides the EXPOST with -p option.
EXPOSE 8080
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry.
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV=production \
DEFAULT_API_BASE_URL_V2=$DEFAULT_API_BASE_URL_V2 \
API_BASE_URL=$API_BASE_URL \
S3_REPO_URL=$S3_REPO_URL \
ID_ANALYTICS=$ID_ANALYTICS \
NEW_RELIC_APP_NAME=$NEW_RELIC_APP_NAME \
NEW_RELIC_LICENSE_KEY=$NEW_RELIC_LICENSE_KEY
CMD ["npm", "run", "start"]