diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0ee0181 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +# NodeJs +node_modules/ +dist/ +.git/ +.env +.strapi +.strapi-updater.json +public/uploads/* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..448cd84 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file