| version: '3.8' |
|
|
| services: |
| ocngx: |
| build: . |
| container_name: ocngx |
| ports: |
| - "7860:7860" |
| environment: |
| |
| - GATEWAY_HOST=127.0.0.1 |
| - GATEWAY_PORT=3000 |
| - USERNAME=admin |
| - PASSWORD=admin123 |
| |
| |
| - SPACE_ID=${SPACE_ID:-} |
| - OPENCODE_PUBLIC_URL=${OPENCODE_PUBLIC_URL:-http://localhost:7860} |
| - PUBLIC_URL=${PUBLIC_URL:-http://localhost:7860} |
| - BASE_URL=${BASE_URL:-http://localhost:7860} |
| |
| |
| - BACKUP_S3_BUCKET=${BACKUP_S3_BUCKET:-} |
| - BACKUP_DIR=${BACKUP_DIR:-/var/backups/ocngx} |
| |
| |
| - LOG_LEVEL=${LOG_LEVEL:-info} |
| |
| volumes: |
| |
| - opencode_data:/root/.opencode |
| - backup_data:/var/backups/ocngx |
| |
| |
| - ./logs:/var/log/nginx |
| |
| |
| - /etc/localtime:/etc/localtime:ro |
| |
| restart: unless-stopped |
| |
| healthcheck: |
| test: ["CMD", "curl", "-f", "http://localhost:7860/health"] |
| interval: 30s |
| timeout: 10s |
| retries: 3 |
| start_period: 40s |
| |
| networks: |
| - ocngx_network |
|
|
| |
| backup-scheduler: |
| image: alpine:latest |
| container_name: ocngx-backup |
| depends_on: |
| - ocngx |
| volumes: |
| - backup_data:/backups:ro |
| - ./backup-scripts:/scripts:ro |
| environment: |
| - BACKUP_S3_BUCKET=${BACKUP_S3_BUCKET:-} |
| - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} |
| - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} |
| - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-us-east-1} |
| command: > |
| sh -c " |
| apk add --no-cache curl tar jq && |
| echo '0 2 * * * /scripts/backup.sh' > /etc/crontabs/root && |
| crond -f -l 2 |
| " |
| restart: unless-stopped |
| networks: |
| - ocngx_network |
|
|
| volumes: |
| opencode_data: |
| driver: local |
| backup_data: |
| driver: local |
|
|
| networks: |
| ocngx_network: |
| driver: bridge |