From f5ff616491bce1a3463428366923fcf0a6ac7df9 Mon Sep 17 00:00:00 2001 From: catensia Date: Thu, 1 Dec 2022 21:29:04 +0900 Subject: [PATCH] feat: Initial release --- .dockerignore | 5 +++++ Dockerfile.prod | 15 +++++++++++++++ docker-compose.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile.prod create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0b7d2c7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +Dockerfile +.git +.gitignore +.dockerignore \ No newline at end of file diff --git a/Dockerfile.prod b/Dockerfile.prod new file mode 100644 index 0000000..bf14beb --- /dev/null +++ b/Dockerfile.prod @@ -0,0 +1,15 @@ +FROM node:latest + +WORKDIR /usr/src/app + +COPY . ./ + +WORKDIR /usr/src/app/client +RUN npm install +RUN npm run build + +WORKDIR /usr/src/app/server +RUN npm install +RUN npm run build + +EXPOSE 4000 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..d94f6d3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3.8" + +services: + prod: + build: + context: . + dockerfile: Dockerfile.prod + container_name: prod + ports: + - "4000:4000" + command: npm run start + networks: + - webnet + depends_on: + - redis + + redis: + container_name: redis + image: redis:5 + command: redis-server + networks: + - webnet + ports: + - "6379:6379" + +networks: + webnet: