101 lines
3 KiB
YAML
101 lines
3 KiB
YAML
services:
|
|
|
|
guestbooky-be:
|
|
image: cotti/guestbooky-be
|
|
container_name: guestbooky-be
|
|
ports:
|
|
- "127:0.0.1:8080:8080"
|
|
environment:
|
|
ASPNETCORE_ENVIRONMENT: Production
|
|
CORS_ORIGINS: ${CORS_ORIGINS}
|
|
ACCESS_USERNAME: ${ACCESS_USERNAME}
|
|
ACCESS_PASSWORD: ${ACCESS_PASSWORD}
|
|
ACCESS_TOKENKEY: ${ACCESS_TOKENKEY}
|
|
ACCESS_ISSUER: ${ACCESS_ISSUER}
|
|
ACCESS_AUDIENCE: ${ACCESS_AUDIENCE}
|
|
CLOUDFLARE_SECRET: ${CLOUDFLARE_SECRET}
|
|
MONGODB_CONNECTIONSTRING: mongodb://${GUESTBOOKY_USER}:${GUESTBOOKY_PASSWORD}@mongo:27017/${GUESTBOOKY_DB_NAME}
|
|
MONGODB_DATABASENAME: ${GUESTBOOKY_DB_NAME}
|
|
LOG_LEVEL: Debug
|
|
depends_on:
|
|
- mongo
|
|
restart: unless-stopped
|
|
networks:
|
|
- guestbooky
|
|
|
|
mongo:
|
|
image: mongo
|
|
container_name: mongo
|
|
restart: always
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
|
|
GUESTBOOKY_DB_NAME: ${GUESTBOOKY_DB_NAME}
|
|
GUESTBOOKY_USER: ${GUESTBOOKY_USER}
|
|
GUESTBOOKY_PASSWORD: ${GUESTBOOKY_PASSWORD}
|
|
volumes:
|
|
- ./mongodb/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
|
|
- ./mongodb/mongod.conf:/etc/mongod.conf:ro
|
|
- mongodata:/data/db
|
|
command: ["mongod", "--config", "/etc/mongod.conf"]
|
|
networks:
|
|
- guestbooky
|
|
|
|
cron:
|
|
image: mcuadros/ofelia:latest
|
|
container_name: ofelia-cron
|
|
command: daemon --docker
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- ./docker-compose.yml:/etc/docker-compose.yml:ro
|
|
labels:
|
|
ofelia.job-run.backup: "0 0 * * * docker-compose -f /etc/docker-compose.yml run --rm backup-job"
|
|
ofelia.job-run.upload: "0 0 * * * docker-compose -f /etc/docker-compose.yml run --rm upload"
|
|
networks:
|
|
- guestbooky
|
|
env_file:
|
|
- .env
|
|
|
|
backup-job:
|
|
container_name: mongo-backup-job
|
|
image: mongo
|
|
command: >
|
|
bash -c "mongodump
|
|
--host mongo
|
|
--db ${GUESTBOOKY_DB_NAME}
|
|
--username ${GUESTBOOKY_USER}
|
|
--password ${GUESTBOOKY_USER}
|
|
--authenticationDatabase ${GUESTBOOKY_DB_NAME}
|
|
--out ${BACKUP_SOURCE_PATH} && touch /backups/backup_done"
|
|
volumes:
|
|
- ./backups:/backups
|
|
depends_on:
|
|
- mongo
|
|
networks:
|
|
- guestbooky
|
|
healthcheck:
|
|
test: ["CMD", "test", "-f", "/backups/backup_done"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
upload:
|
|
image: cotti/guestbooky-backup
|
|
container_name: guestbooky-backup
|
|
environment:
|
|
BACKUP_S3_KEY_NAME: ${BACKUP_S3_KEY_NAME}
|
|
BACKUP_S3_ACCESS_ID: ${BACKUP_S3_ACCESS_ID}
|
|
BACKUP_S3_SECRET_ID: ${BACKUP_S3_SECRET_ID}
|
|
BACKUP_S3_ENDPOINT: ${BACKUP_S3_ENDPOINT}
|
|
BACKUP_S3_REGION: ${BACKUP_S3_REGION}
|
|
BACKUP_SOURCE_PATH: ${BACKUP_SOURCE_PATH}
|
|
BACKUP_DESTINATION_PATH: ${BACKUP_SOURCE_PATH}.gzip
|
|
volumes:
|
|
- ./backups:/backups
|
|
|
|
volumes:
|
|
mongodata:
|
|
|
|
networks:
|
|
guestbooky:
|
|
driver: bridge
|