From 50bc0e8a1b250ab0335ceb3abb01a9e527bc6608 Mon Sep 17 00:00:00 2001 From: VictoriqueMoe Date: Wed, 26 Jun 2024 21:32:23 +0100 Subject: [PATCH] support docker --- .dockerignore | 2 ++ Dockerfile | 21 +++++++++++++++++++++ docker-compose.yml | 16 ++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..44d646d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +dist/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0db54c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:lts as base + +WORKDIR /home/node/app + +COPY package*.json ./ + +RUN npm i + +COPY . . + +FROM base as production + +ENV NODE_PATH=./dist + +RUN npm run build + +EXPOSE 8081 +ENV PORT 8081 +ENV NODE_ENV production + +CMD [ "npm", "run" ,"start:prod" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0895b8e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +version: '3.8' +services: + server: + build: + context: . + dockerfile: ./Dockerfile + args: + - http_proxy + - https_proxy + - no_proxy + image: tsed/server:latest + restart: always + ports: + - "8081:8081" + stdin_open: true # -i + tty: true # -t