Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 29 additions & 45 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
networks:
cc-shared-network:
external: true
name: cc-prod-shared-network

volumes:
subgraphs_data:

services:
mongo:
image: mongo:4.4
volumes:
- /mnt/share/mongo:/data/db
env_file:
- $CC_CONFIG_PATH/prod/global
restart: unless-stopped

gateway:
# image: cc-gateway:${IMAGE_TAG_GATEWAY:-latest}
build: ./gateway
Expand All @@ -26,42 +23,25 @@ services:
- members
- events
- users
networks:
- cc-shared-network
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:80/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})\""]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
restart: unless-stopped

nginx:
build: ./nginx
volumes:
- ./nginx:/etc/nginx/conf.d
depends_on:
- auth
- files
- gateway
- web
environment:
- VIRTUAL_HOST=clubs.iiit.ac.in
- LETSENCRYPT_HOST=clubs.iiit.ac.in
ports:
- "8000:80"
restart: unless-stopped

# feeder:
# image: cc-feeder:${IMAGE_TAG_FEEDER:-latest}
# build: ./feeder
# volumes:
# - ./data:/data
# depends_on:
# - mongo
# env_file:
# - $CC_CONFIG_PATH/prod/global
# restart: no

web:
image: cc-web:${IMAGE_TAG_WEB:-latest}
# build:
# context: ./web
env_file:
- $CC_CONFIG_PATH/prod/global
- $CC_CONFIG_PATH/prod/web
networks:
- cc-shared-network
restart: unless-stopped

auth:
Expand All @@ -72,6 +52,8 @@ services:
- $CC_CONFIG_PATH/prod/auth
volumes:
- ./config:/app/config
networks:
- cc-shared-network
restart: unless-stopped

files:
Expand All @@ -84,6 +66,8 @@ services:
env_file:
- $CC_CONFIG_PATH/prod/global
- $CC_CONFIG_PATH/prod/files
networks:
- cc-shared-network
restart: unless-stopped

# subgraphs
Expand All @@ -93,11 +77,11 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/prod/global
- $CC_CONFIG_PATH/prod/interfaces
networks:
- cc-shared-network
restart: unless-stopped

clubs:
Expand All @@ -106,10 +90,10 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/prod/global
networks:
- cc-shared-network
restart: unless-stopped

members:
Expand All @@ -118,10 +102,10 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/prod/global
networks:
- cc-shared-network
restart: unless-stopped

events:
Expand All @@ -130,10 +114,10 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/prod/global
networks:
- cc-shared-network
restart: unless-stopped

users:
Expand All @@ -142,8 +126,8 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/prod/global
networks:
- cc-shared-network
restart: unless-stopped
28 changes: 28 additions & 0 deletions docker-compose.shared.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
networks:
cc-shared-network:
name: cc-prod-shared-network
driver: bridge

services:
mongo:
image: mongo:4.4
volumes:
- /mnt/share/mongo:/data/db
env_file:
- $CC_CONFIG_PATH/prod/global
networks:
- cc-shared-network
restart: unless-stopped

nginx:
build: ./nginx
volumes:
- ./nginx:/etc/nginx/conf.d
environment:
- VIRTUAL_HOST=clubs.iiit.ac.in
- LETSENCRYPT_HOST=clubs.iiit.ac.in
ports:
- "8000:80"
networks:
- cc-shared-network
restart: unless-stopped
Comment on lines +17 to +28
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nginx service in the shared compose file lacks a depends_on directive to ensure the application services (auth, files, gateway, web) are started before nginx. While these services are in a separate compose file, nginx will attempt to proxy to them and should wait for them to be available, or at least document that the main compose stack must be started first.

Consider adding a comment or documentation about the startup order requirement, since cross-compose depends_on doesn't work.

Copilot uses AI. Check for mistakes.
28 changes: 28 additions & 0 deletions docker-compose.shared.staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
networks:
cc-shared-network:
name: cc-staging-shared-network
driver: bridge

services:
mongo:
image: mongo:4.4
volumes:
- /mnt/share/mongo_stage:/data/db
env_file:
- $CC_CONFIG_PATH/staging/global
networks:
- cc-shared-network
restart: unless-stopped

nginx:
build: ./nginx
volumes:
- ./nginx:/etc/nginx/conf.d
environment:
- VIRTUAL_HOST=dev-clubs.iiit.ac.in
# - LETSENCRYPT_HOST=clubs.iiit.ac.in
ports:
- "9000:80"
networks:
- cc-shared-network
restart: unless-stopped
Comment on lines +17 to +28
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nginx service in the shared compose file lacks a depends_on directive to ensure the application services (auth, files, gateway, web) are started before nginx. While these services are in a separate compose file, nginx will attempt to proxy to them and should wait for them to be available, or at least document that the main compose stack must be started first.

Consider adding a comment or documentation about the startup order requirement, since cross-compose depends_on doesn't work.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation can be added

73 changes: 29 additions & 44 deletions docker-compose.staging.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
networks:
cc-shared-network:
external: true
name: cc-staging-shared-network

volumes:
subgraphs_data:

services:
mongo:
image: mongo:4.4
volumes:
- /mnt/share/mongo_stage:/data/db
env_file:
- $CC_CONFIG_PATH/staging/global
restart: unless-stopped

gateway:
# image: cc-gateway:${IMAGE_TAG_GATEWAY:-latest}
build: ./gateway
Expand All @@ -26,39 +23,23 @@ services:
- members
- events
- users
networks:
- cc-shared-network
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:80/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})\""]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
restart: unless-stopped

nginx:
build: ./nginx
volumes:
- ./nginx:/etc/nginx/conf.d
depends_on:
- auth
- files
- gateway
- web
environment:
- VIRTUAL_HOST=dev.clubs.iiit.ac.in
# - LETSENCRYPT_HOST=clubs.iiit.ac.in
ports:
- "9000:80"
restart: unless-stopped

# feeder:
# image: cc-feeder:${IMAGE_TAG_FEEDER:-latest}
# volumes:
# - ./data:/data
# depends_on:
# - mongo
# env_file:
# - $CC_CONFIG_PATH/staging/global
# restart: no

web:
image: cc-web:${IMAGE_TAG_WEB:-latest}
env_file:
- $CC_CONFIG_PATH/staging/global
- $CC_CONFIG_PATH/staging/web
networks:
- cc-shared-network
restart: unless-stopped

auth:
Expand All @@ -68,6 +49,8 @@ services:
- $CC_CONFIG_PATH/staging/auth
volumes:
- ./config:/app/config
networks:
- cc-shared-network
restart: unless-stopped

files:
Expand All @@ -79,6 +62,8 @@ services:
env_file:
- $CC_CONFIG_PATH/staging/global
- $CC_CONFIG_PATH/staging/files
networks:
- cc-shared-network
restart: unless-stopped

# subgraphs
Expand All @@ -87,53 +72,53 @@ services:
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/staging/global
- $CC_CONFIG_PATH/staging/interfaces
networks:
- cc-shared-network
restart: unless-stopped

clubs:
image: cc-clubs:${IMAGE_TAG_CLUBS:-latest}
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/staging/global
networks:
- cc-shared-network
restart: unless-stopped

members:
image: cc-members:${IMAGE_TAG_MEMBERS:-latest}
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/staging/global
networks:
- cc-shared-network
restart: unless-stopped

events:
image: cc-events:${IMAGE_TAG_EVENTS:-latest}
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/staging/global
networks:
- cc-shared-network
restart: unless-stopped

users:
image: cc-users:${IMAGE_TAG_USERS:-latest}
volumes:
- subgraphs_data:/subgraphs
- ./config:/app/config
depends_on:
- mongo
env_file:
- $CC_CONFIG_PATH/staging/global
networks:
- cc-shared-network
restart: unless-stopped
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ services:
env_file:
- ./.env.example
- ./gateway/.env.example
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:80/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})\""]
interval: 10s
timeout: 10s
retries: 30
start_period: 60s
depends_on:
- interfaces
- clubs
Expand Down
Loading