From 37b6eae2ee7d00c43fda50db5d04814e040b3049 Mon Sep 17 00:00:00 2001 From: AbhayMishra Date: Sun, 10 Nov 2024 02:08:17 +0530 Subject: [PATCH] fixed docker-compose.dev.yaml & separated docker-compose.cloud.yaml --- docker-compose.cloud.yaml | 74 +++++++++++++++++++++++++++++++++++++++ docker-compose.dev.yaml | 22 ++++-------- 2 files changed, 80 insertions(+), 16 deletions(-) create mode 100644 docker-compose.cloud.yaml diff --git a/docker-compose.cloud.yaml b/docker-compose.cloud.yaml new file mode 100644 index 0000000000..a1a58385fe --- /dev/null +++ b/docker-compose.cloud.yaml @@ -0,0 +1,74 @@ +version: "3.8" + +services: + mongodb: + image: mongo:latest + ports: + - 27017:27017 + volumes: + - mongodb-data:/data/db + networks: + - talawa-network + + redis-stack-server: + image: redis/redis-stack-server:latest + ports: + - 6379:6379 + volumes: + - redis-data:/data/redis + networks: + - talawa-network + + minio: + image: minio/minio + ports: + - "9000:9000" + - "9001:9001" + environment: + - MINIO_ROOT_USER=${MINIO_ROOT_USER} + - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} + command: server /data --console-address ":9001" + volumes: + - minio-data:/data + networks: + - talawa-network + + talawa-api-dev: + build: + context: . + dockerfile: Dockerfile.dev + volumes: + - .:/usr/src/app + - /usr/src/app/node_modules + depends_on: + - mongodb + - redis-stack-server + - minio + environment: + - MONGO_DB_URL=mongodb://mongodb:27017/talawa-api + - REDIS_HOST=redis-stack-server + - REDIS_PORT=6379 + + caddy: + image: caddy/caddy:2.2.1-alpine + container_name: caddy-service + restart: unless-stopped + ports: + - "80:80" + - "443:443" + volumes: + - $PWD/Caddyfile:/etc/caddy/Caddyfile + - $PWD/site:/srv + - caddy_data:/data + - caddy_config:/config + +volumes: + mongodb-data: + redis-data: + caddy_data: + caddy_config: + minio-data: + +networks: + talawa-network: + driver: bridge \ No newline at end of file diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml index a40aee1718..e4bc97363b 100644 --- a/docker-compose.dev.yaml +++ b/docker-compose.dev.yaml @@ -37,6 +37,9 @@ services: build: context: . dockerfile: Dockerfile.dev + container_name: talawa-api-dev + ports: + - "4000:4000" volumes: - .:/usr/src/app - /usr/src/app/node_modules @@ -45,28 +48,15 @@ services: - redis-stack-server - minio environment: - - MONGO_DB_URL=mongodb://mongodb:27017 + - MONGO_DB_URL=mongodb://mongodb:27017/talawa-api - REDIS_HOST=redis-stack-server - REDIS_PORT=6379 - - caddy: - image: caddy/caddy:2.2.1-alpine - container_name: caddy-service - restart: unless-stopped - ports: - - "80:80" - - "443:443" - volumes: - - $PWD/Caddyfile:/etc/caddy/Caddyfile - - $PWD/site:/srv - - caddy_data:/data - - caddy_config:/config + networks: + - talawa-network volumes: mongodb-data: redis-data: - caddy_data: - caddy_config: minio-data: networks: