From 1047364daf84e049bb76fd6f845210aa092760fb Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Tue, 5 Nov 2024 16:18:37 +0100 Subject: [PATCH] dockerize --- .dockerignore | 8 ++++++++ Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile 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