Dockerfile and Docker compose

This commit is contained in:
Christoph Walther
2024-07-16 14:03:13 +02:00
parent 843daf8a35
commit ca84202168
12 changed files with 393 additions and 12 deletions

54
docker-compose.yml Normal file
View File

@ -0,0 +1,54 @@
services:
db:
image: postgres:16
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: codeocean_user
POSTGRES_PASSWORD: secure_password
POSTGRES_DB: codeocean_production
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/codeocean
- config:/codeocean/config
ports:
- "7123:7000"
depends_on:
- db
- prometheus
environment:
POSTGRES_USER: codeocean_user
POSTGRES_PASSWORD: secure_password
ADMIN_MAIL: support@htwkalender.de
ADMIN_PASSWORD: htwkalender
RAILS_ENV: production
PROMETHEUS_EXPORTER_HOST: prometheus
PROMETHEUS_EXPORTER_PORT: 9090
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- "9090:9090"
nginx:
image: nginx:latest
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./nginx/certs:/etc/nginx/certs
ports:
- "443:443"
depends_on:
- app
restart: always
volumes:
db_data:
config: