-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (34 loc) · 1.02 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
42
43
44
45
46
FROM node:14-slim AS builder
# Public variables are only required at build time.
ARG NEXT_PUBLIC_BUILD_TIME_COURSE_LIMIT
ARG NEXT_PUBLIC_GRADES_API_URL
ARG NEXT_PUBLIC_CANONICAL_URL
ARG NEXT_PUBLIC_SENTRY_DSN
ARG NEXT_PUBLIC_GA_TRACKING_ID
ARG NEXT_PUBLIC_FEIDE_CLIENT_ID
ARG NEXT_PUBLIC_FEIDE_AUTH_ENDPOINT
ARG GITHUB_TOKEN
ENV NEXT_PRIVATE_GITHUB_TOKEN=$GITHUB_TOKEN
ENV WORKDIR=/srv/app
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
WORKDIR $WORKDIR
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY . .
RUN npm run build
FROM node:14-slim
LABEL maintainer="[email protected]"
ENV WORKDIR=/srv/app
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
WORKDIR $WORKDIR
RUN ls
COPY --from=builder $WORKDIR/node_modules ./node_modules
COPY --from=builder $WORKDIR/.next ./.next
COPY --from=builder $WORKDIR/public ./public
COPY --from=builder $WORKDIR/next.config.js ./next.config.js
COPY --from=builder $WORKDIR/package.json ./package.json
EXPOSE 3000
CMD ["npm", "start", "--","--hostname", "0.0.0.0"]