Skip to content
Snippets Groups Projects
Commit f5c5b005 authored by Jesus Galaz's avatar Jesus Galaz
Browse files

feat: add support for horizontal scaling with multiple back-end instances in docker-compose

parent b528faec
No related branches found
No related tags found
1 merge request!12Resolve "Exercise 3 - Scaling: Mandatory features"
Pipeline #16868 passed
version: '3.9'
services: services:
mongodb: mongodb:
image: mongo:latest image: mongo:latest
...@@ -9,14 +10,27 @@ services: ...@@ -9,14 +10,27 @@ services:
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD} - MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
- MONGO_INITDB_DATABASE=todo-app - MONGO_INITDB_DATABASE=todo-app
todo-app: todo-app-1:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: todo-app container_name: todo-app-1
ports: ports:
- "80:3000" - "3001:3000"
depends_on: depends_on:
- mongodb - mongodb
environment: environment:
- MONGO_URI=${MONGO_URI} - MONGO_URI=${MONGO_URI}
- PORT=3000
todo-app-2:
build:
context: .
dockerfile: Dockerfile
container_name: todo-app-2
ports:
- "3002:3000"
depends_on:
- mongodb
environment:
- MONGO_URI=${MONGO_URI}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment