dockerize

This commit is contained in:
Julian Krauser 2024-11-05 16:18:37 +01:00
parent 4cd47c5d4c
commit 1047364daf
2 changed files with 30 additions and 0 deletions

8
.dockerignore Normal file
View file

@ -0,0 +1,8 @@
# NodeJs
node_modules/
dist/
.git/
.env
.strapi
.strapi-updater.json
public/uploads/*

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json /app
RUN npm install
COPY . /app
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN npm run build
FROM node:18-alpine AS prod
WORKDIR /app
COPY --from=build /app /app
EXPOSE 1337
CMD ["npm", "run", "start"]