From 957554c32e1d00027f036c06b06cd16e908756b5 Mon Sep 17 00:00:00 2001 From: Sascha Depold Date: Sun, 10 Sep 2023 19:48:10 +0200 Subject: [PATCH] Add Docker for website --- web/Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 web/Dockerfile diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..fe498db --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,22 @@ +FROM node:18-alpine AS BUILD_IMAGE + +ENV NPM_CONFIG_LOGLEVEL warn +ENV NODE_ENV production +ENV PORT 3000 + +RUN apk update && apk add yarn curl bash python3 g++ make + +WORKDIR /srv/app + +COPY . . + +RUN yarn --frozen-lockfile +RUN yarn build + +# Prune dev dependencies +RUN npm prune --production +RUN curl -sf https://gobinaries.com/tj/node-prune | sh + +EXPOSE 3000 + +CMD ["node_modules/.bin/next", "start"]