pretendo-docker/compose.yml
2023-12-20 16:03:38 -05:00

228 lines
5.9 KiB
YAML

name: pretendo-network
version: "3.8"
services:
mitmproxy-pretendo:
image: ghcr.io/matthewl246/mitmproxy-pretendo:main
# build: ./repos/mitmproxy-pretendo
ports:
# Proxy server
- 8080:8080
# Mitmweb interface
- 127.0.0.1:8081:8081
volumes:
- type: bind
source: ./config/mitmproxy.yaml
target: /home/mitmproxy/mitmproxy-config.yaml
- type: volume
source: mitmproxy-pretendo-data
target: /home/mitmproxy/.mitmproxy
command: mitmweb --web-host 0.0.0.0
tty: true
coredns:
image: coredns/coredns:latest
volumes:
- type: bind
source: ./config/Corefile
target: /etc/coredns/Corefile
networks:
internal:
ipv4_address: 172.20.0.2
command: -conf /etc/coredns/Corefile
nginx:
image: nginx:mainline-alpine
depends_on:
- coredns
ports:
- 80:80
- 443:443
volumes:
- type: bind
source: ./config/nginx.conf
target: /etc/nginx/nginx.conf
- type: bind
source: ./config/nginx
target: /etc/nginx/conf.d/
dns: 172.20.0.2
networks:
default:
internal:
mongodb:
# TODO: Set up authentication
image: mongo:latest
depends_on:
- coredns
ports:
# For connecting with mongosh or MongoDB Compass
- 127.0.0.1:27017:27017
volumes:
- type: bind
source: ./config/mongod.conf
target: /etc/mongod.conf
- type: volume
source: mongodb-database
target: /data/db
dns: 172.20.0.2
networks:
internal:
command: --config "/etc/mongod.conf" --replSet rs
mongo-express:
image: mongo-express:latest
depends_on:
- coredns
ports:
# Web interface
- 127.0.0.1:8090:8081
env_file:
- ./environment/mongo-express.env
- ./environment/mongo-express.local.env
dns: 172.20.0.2
networks:
internal:
minio:
image: minio/minio:latest
depends_on:
- coredns
ports:
# Web console
- 127.0.0.1:9090:9090
env_file:
- ./environment/minio.env
- ./environment/minio.local.env
volumes:
- type: volume
source: minio-s3-data
target: /data
command: server /data --console-address ":9090"
dns: 172.20.0.2
networks:
internal:
redis:
image: redis:alpine
depends_on:
- coredns
volumes:
- type: volume
source: redis-data
target: /data
command: redis-server --save 60 1 --appendonly yes
dns: 172.20.0.2
networks:
internal:
# TODO: MailDev appears to be unmaintained and has security vulnerabilities.
# Find an alternative. MailCatcher doesn't support persistance, and MailHog
# also seems unmaintained.
maildev:
image: maildev/maildev:latest
depends_on:
- coredns
ports:
# MailDev web UI
- 127.0.0.1:1080:1080
volumes:
- type: volume
source: maildev-mail
target: /data
# We need to set the user to root so that MailDev can write to the volume.
user: root
env_file:
- ./environment/maildev.env
dns: 172.20.0.2
networks:
internal:
postgres:
image: postgres:alpine
depends_on:
- coredns
volumes:
- type: volume
source: postgres-database
target: /var/lib/postgresql/data
- type: bind
source: ./config/postgres-init.sh
target: /docker-entrypoint-initdb.d/postgres-init.sh
env_file:
- ./environment/postgres.env
- ./environment/postgres.local.env
dns: 172.20.0.2
networks:
internal:
adminer:
image: adminer:latest
depends_on:
- coredns
- postgres
ports:
# For the Adminer web interface
- 127.0.0.1:8091:8080
env_file:
- ./environment/adminer.env
dns: 172.20.0.2
networks:
internal:
account:
build: ./repos/account
depends_on:
- coredns
- nginx
- mongodb
- minio
- redis
- maildev
ports:
# For the Node.js debugger
- 127.0.0.1:9229:9229
env_file:
- ./environment/account.env
- ./environment/account.local.env
volumes:
- type: volume
source: account-certificates
target: /app/certs
dns: 172.20.0.2
networks:
internal:
website:
build: ./repos/website
depends_on:
- mongodb
- account
ports:
# For the Node.js debugger
- 127.0.0.1:9230:9230
volumes:
- type: bind
source: ./config/website-config.json
target: /app/config.json
dns: 172.20.0.2
networks:
internal:
volumes:
mitmproxy-pretendo-data:
mongodb-database:
minio-s3-data:
redis-data:
maildev-mail:
postgres-database:
account-certificates:
networks:
# We need to use a custom network so that we can set a static IP address for
# CoreDNS and use it as a DNS server for the other containers.
internal:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16