96 lines
2.2 KiB
YAML
96 lines
2.2 KiB
YAML
services:
|
|
nginx:
|
|
build:
|
|
context: ..
|
|
dockerfile: dockerfiles/nginx/Dockerfile
|
|
ports:
|
|
- "80:80"
|
|
depends_on:
|
|
- db
|
|
- etherpad
|
|
- back
|
|
- front
|
|
networks:
|
|
- app-network
|
|
|
|
front:
|
|
build:
|
|
context: ..
|
|
dockerfile: dockerfiles/front/Dockerfile
|
|
|
|
ports:
|
|
- "5000:5000"
|
|
- "5080:80"
|
|
volumes:
|
|
- ../doodlestudent/front:/app
|
|
environment:
|
|
- FLASK_ENV=development
|
|
depends_on:
|
|
- back
|
|
networks:
|
|
- app-network
|
|
|
|
back:
|
|
build:
|
|
context: ..
|
|
dockerfile: dockerfiles/back/DockerfileUsingApiNative
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ../doodlestudent/api:/app
|
|
environment:
|
|
- FLASK_ENV=development
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
etherpad:
|
|
condition: service_healthy
|
|
networks:
|
|
- app-network
|
|
restart:
|
|
unless-stopped
|
|
|
|
db:
|
|
image: mysql
|
|
ports:
|
|
- "3306:3306"
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=root
|
|
- MYSQL_DATABASE=tlc
|
|
- MYSQL_USER=tlc
|
|
- MYSQL_PASSWORD=tlc
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"]
|
|
interval: 10s
|
|
timeout: 1m
|
|
retries: 5
|
|
networks:
|
|
- app-network
|
|
|
|
etherpad:
|
|
image: etherpad/etherpad:1.9.7
|
|
ports:
|
|
- "9001:9001"
|
|
volumes:
|
|
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
|
networks:
|
|
- app-network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:9001', res => { process.exit(res.statusCode===200?0:1) }).on('error', ()=>process.exit(1))\""]
|
|
interval: 30s
|
|
timeout: 10s
|
|
start_period: 15s
|
|
retries: 5
|
|
|
|
mail:
|
|
image: bytemark/smtp
|
|
restart: always
|
|
ports:
|
|
- "2525:25"
|
|
networks:
|
|
- app-network
|
|
|
|
networks: # Declare the network to be used by the services
|
|
app-network: # Is a user-defined network
|
|
#external: false # If true, Docker Compose will look for an existing network with the same name and use it. If false or not specified, Docker Compose will create a new network.
|
|
name: app-network #Name of the network (optional, Docker Compose will generate one if not provided) |