From c138dceb70b8445e2e18721e165f10c350710936 Mon Sep 17 00:00:00 2001 From: Ajan Lal Shrestha Date: Tue, 24 Dec 2019 20:42:45 +0545 Subject: [PATCH] feat(docker): Add docker-compose to handle all the docker containers --- docker-compose.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++ makefile | 9 ++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..789583c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,50 @@ +version: '3.7' +services: + client: + image: ajreddevil/client-job-board + restart: always + container_name: client + ports: + - '80:80' + links: + - api + depends_on: + - api + networks: + - webappnetwork + api: + image: ajreddevil/api-job-board + restart: always + container_name: api + ports: + - '5000:5000' + environment: + NODE_ENV: 'docker' + depends_on: + - redis + networks: + - webappnetwork + worker: + image: ajreddevil/worker-job-board + restart: always + container_name: worker + environment: + NODE_ENV: 'docker' + depends_on: + - redis + networks: + - webappnetwork + redis: + image: redis + restart: always + container_name: redis + volumes: + - ${PWD}/data:/data + ports: + - 6379:6379 + command: redis-server --appendonly yes + networks: + - webappnetwork +networks: + webappnetwork: + driver: bridge diff --git a/makefile b/makefile index 3a98089..fb61fb9 100644 --- a/makefile +++ b/makefile @@ -68,4 +68,11 @@ start-redis: stop-redis: docker stop redis - docker rm redis \ No newline at end of file + docker rm redis + +# RUN cmd +run-job-board: + docker-compose -p job-board up -d + +stop-job-board: + docker-compose -p job-board down \ No newline at end of file