Official Docker image (#46)

* Initial Dockerfile

* Docker added to Readme

* Added Docker to Travis
This commit is contained in:
David
2021-09-05 16:44:05 +02:00
committed by GitHub
parent 1adbe08056
commit 4df0d40dcf
4 changed files with 92 additions and 1 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
# https://nextjs.org/docs/deployment#docker-image
FROM node:alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
FROM node:alpine AS builder
WORKDIR /app
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
COPY --chown=nextjs:nodejs . .
COPY --from=deps /app/node_modules ./node_modules
RUN chown nextjs:nodejs .
USER nextjs
EXPOSE 3000
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
CMD NEXT_PUBLIC_SITE_DOMAIN=$site_domain yarn build && yarn start