initial commit

This commit is contained in:
Mohammed Hawamdeh 2021-06-07 14:17:26 +03:00
parent 8ff991327f
commit 3dfb16658b
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,10 @@
.git
node_modules
out
.next
.vscode
.prettier*
/eslintrc*
TODO
.editorconfig
**.log

View File

@ -0,0 +1,34 @@
# Statically build nextjs, deploy on ngnix
# To build:
# docker build -t nextjs-static -f ./dockerfile .
# To run:
# docker run --rm -e 'PORT=80' -p 80:80 -d --name nextjs-static nextjs-static:latest
FROM node:latest as builder
WORKDIR /app
# install deps
COPY package.json yarn.lock ./
RUN yarn --production --frozen-lockfile
#copy the directory after install is done
COPY . .
#export
RUN yarn next build && yarn next export
#stage2
FROM nginx:alpine
COPY nginx /etc/nginx/
# ## Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*
# # Copy static files from the builder
COPY --from=builder /app/out /usr/share/nginx/html
ENTRYPOINT ["nginx", "-g", "daemon off;"]