From 38385d56d9d4c68c0868e7df187f2e3a1bfc0827 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Tue, 5 Nov 2024 16:18:39 +0100 Subject: [PATCH] dockerize --- .dockerignore | 5 +++++ Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d448282 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +# NodeJs +node_modules/ +.git/ +.nuxt/ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5225ebb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM node:18-alpine AS build + +WORKDIR /app + +COPY package*.json /app + +RUN npm install + +COPY . /app + +RUN npm run build + +FROM node:18-alpine AS prod + +WORKDIR /app + +COPY --from=build /app/.output /app/.output + +ENV NUXT_HOST=0.0.0.0 +ENV NUXT_PORT=3000 + +EXPOSE 3000 + +CMD ["node", ".output/server/index.mjs"] \ No newline at end of file