freeCodeCamp/docker-compose.yml
Mrugesh Mohapatra ef610dd36c
Some checks failed
i18n - Build Validation / Validate i18n Builds (22) (push) Has been cancelled
CI - Node.js / Lint (22) (push) Has been cancelled
CI - E2E - 3rd party donation tests / Build Client (22) (push) Has been cancelled
CI - E2E - 3rd party donation tests / Build API (Container) (push) Has been cancelled
CI - Node.js / Build (22) (push) Has been cancelled
CI - Node.js / Test (22) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (22) (push) Has been cancelled
CI - E2E - 3rd party donation tests / Run Playwright 3rd Party Donation Tests (chromium, 22) (push) Has been cancelled
fix(tools): s/MailHog/Mailpit/g (#62481)
2025-10-03 13:25:33 -07:00

40 lines
1.0 KiB
YAML

services:
mongo:
image: mongo
ports:
- '27017:27017'
command: mongod --replSet rs0
setup:
image: mongo
depends_on:
- mongo
restart: on-failure
entrypoint: [
'bash',
'-c',
# This will try to initiate the replica set, until it succeeds twice (i.e. until the replica set is already initialized)
'mongosh --host mongo:27017 --eval ''try {rs.initiate();} catch (err) { if(err.codeName !== "AlreadyInitialized") throw err };'''
]
mailpit:
restart: unless-stopped
image: axllent/mailpit
ports:
- '1025:1025'
- '8025:8025'
api:
restart: unless-stopped
depends_on:
- mongo
- mailpit
image: fcc-api
env_file:
- .env
environment:
# The api cannot connect to mongodb or mailpit via localhost from inside the
# container, so we have to override these variables.
- MONGOHQ_URL=mongodb://mongo:27017/freecodecamp?directConnection=true
- MAILHOG_HOST=mailpit
- HOST=0.0.0.0
ports:
- '3000:3000'