add docker files
This commit is contained in:
70
docker-compose.yml
Normal file
70
docker-compose.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
solardb-api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.api
|
||||
image: solardb-api:latest
|
||||
container_name: solardb-api
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
# nginx-proxy labels (env) for routing + certs
|
||||
VIRTUAL_HOST: ${SOLARDB_API_HOST}
|
||||
LETSENCRYPT_HOST: ${SOLARDB_API_HOST}
|
||||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||
# Flask/TinyDB
|
||||
FLASK_ENV: ${FLASK_ENV:-production}
|
||||
DB_PATH: /data/db.json
|
||||
volumes:
|
||||
- solardb_data:/data
|
||||
expose:
|
||||
- "5001"
|
||||
networks:
|
||||
- reverse-proxy_default
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://localhost:5001/healthz"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
solardb-ui:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.ui
|
||||
image: solardb-ui:latest
|
||||
container_name: solardb-ui
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
VIRTUAL_HOST: ${SOLARDB_UI_HOST}
|
||||
LETSENCRYPT_HOST: ${SOLARDB_UI_HOST}
|
||||
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
|
||||
# Point your UI to the API public URL (https)
|
||||
API_BASE_URL: https://${SOLARDB_API_HOST}
|
||||
# If your entry file differs, uncomment and set it:
|
||||
# FLET_ENTRY: client/main.py
|
||||
volumes:
|
||||
- solardb_uploads:/app/uploads
|
||||
expose:
|
||||
- "5000"
|
||||
depends_on:
|
||||
- solardb-api
|
||||
networks:
|
||||
- reverse-proxy_default
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://localhost:5000/"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
solardb_data:
|
||||
solardb_uploads:
|
||||
|
||||
networks:
|
||||
reverse-proxy_default:
|
||||
external: true
|
||||
Reference in New Issue
Block a user