forked from Matvey-Doshchechnikov/lab_grader_web
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.example.yaml
More file actions
67 lines (63 loc) · 2.27 KB
/
docker-compose.example.yaml
File metadata and controls
67 lines (63 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Example docker-compose.yaml for production deployment
#
# This file is NOT used in development. It's a template for server deployment.
# Copy this to your server at /opt/labgrader/docker-compose.yaml
#
# IMPORTANT: Do NOT commit your actual docker-compose.yaml to git!
# It contains secrets and should only exist on the server.
services:
frontend:
image: ghcr.io/markpolyak/lab_grader_frontend:main
restart: unless-stopped
networks:
- caddy-proxy
labels:
caddy: labgrader.markpolyak.ru
caddy.reverse_proxy: "{{upstreams 8080}}"
# Watchtower labels (optional)
com.centurylinklabs.watchtower.enable: "true"
backend:
image: ghcr.io/markpolyak/lab_grader_backend:main
restart: unless-stopped
volumes:
- ./google-credentials:/app/google-credentials/
- ./courses:/app/courses # Mount courses directory for easy editing
- ./logs:/app/logs # Persistent logs (survive container restarts)
environment:
# Credentials and secrets
CREDENTIALS_FILE: /app/google-credentials/credentials.json
GITHUB_TOKEN: ${GITHUB_TOKEN}
ADMIN_LOGIN: ${ADMIN_LOGIN}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
# Logging configuration
LOG_DIR: /app/logs # Directory for persistent log files
LOG_LEVEL: INFO # Options: DEBUG, INFO, WARNING, ERROR (use DEBUG for detailed troubleshooting)
labels:
caddy: labgrader.markpolyak.ru
# API endpoints
caddy.handle_path: /api/v1*
caddy.handle_path.0_reverse_proxy: "{{upstreams 8000}}"
# Course logos (served by backend)
caddy.handle_path_1: /courses/logos*
caddy.handle_path_1.0_reverse_proxy: "{{upstreams 8000}}"
# Watchtower labels (optional)
com.centurylinklabs.watchtower.enable: "true"
networks:
- caddy-proxy
networks:
caddy-proxy:
external: true
# Alternative configuration using environment variable for branch:
#
# services:
# frontend:
# image: ghcr.io/markpolyak/lab_grader_frontend:${BRANCH:-main}
# backend:
# image: ghcr.io/markpolyak/lab_grader_backend:${BRANCH:-main}
#
# Then you can switch branches with:
# BRANCH=feature-xyz docker compose up -d --pull=always --force-recreate
#
# Or create a .env file with:
# BRANCH=feature-xyz