Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/deploy-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ jobs:
deploy-production:
runs-on: ubuntu-latest
steps:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/[email protected]
with:
args: "Deploying production Dashboard with tag `${{ github.event.inputs.tag }}`"

- name: Configure host authenticity
run: |
mkdir -p ~/.ssh/ && chmod 700 ~/.ssh/
Expand Down
82 changes: 44 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
x-backend-common: &backend-common
build:
context: ./backend
args:
BACKEND_VOLUME_DIR: ${BACKEND_VOLUME_DIR:-/volume_data}
volumes:
- backend-data:${BACKEND_VOLUME_DIR:-/volume_data}
- ../data:/app
- ../spool:/app/spool
env_file:
- .env.backend
secrets:
- postgres_password_secret
networks:
- private
- public

volumes:
backend-data:
runtime-data:
Expand All @@ -13,6 +30,33 @@ secrets:
file: ./backend/runtime/secrets/postgres_password_secret

services:

backend:
<<: *backend-common
container_name: dashboard_backend_service
restart: always
depends_on:
- redis
- dashboard_db
ports:
- target: 8000
published: 8000
protocol: tcp
mode: host

ingester:
<<: *backend-common
container_name: dashboard_ingester_service
# same image/build as backend; just different command
command: >
poetry run python3 manage.py monitor_submissions
--spool-dir /app/spool
restart: always
depends_on:
- redis
- dashboard_db
profiles: ["self-hosted"]

dashboard_db:
image: postgres:17
env_file:
Expand All @@ -24,18 +68,6 @@ services:
ports:
- "5434:5432"

cloudsql-proxy:
image: gcr.io/cloudsql-docker/gce-proxy:latest
container_name: cloudsql-proxy
command: /cloud_sql_proxy --dir=/cloudsql -instances=kernelci-production:us-central1:postgresql2=tcp:0.0.0.0:5432 -credential_file=/secrets/cloudsql/application_default_credentials.json
ports:
- 5432:5432
volumes:
- ./application_default_credentials.json:/secrets/cloudsql/application_default_credentials.json
networks:
- private
restart: always

redis:
image: redis:8.0-M04-alpine
restart: always
Expand All @@ -44,32 +76,6 @@ services:
ports:
- 6379:6379

backend:
build:
context: ./backend
args:
BACKEND_VOLUME_DIR: ${BACKEND_VOLUME_DIR:-/volume_data}
volumes:
- backend-data:${BACKEND_VOLUME_DIR:-/volume_data}
restart: always
container_name: dashboard_backend_service
networks:
- private
- public
ports:
- target: 8000
published: 8000
protocol: tcp
mode: host
depends_on:
- cloudsql-proxy
- redis
- dashboard_db
secrets:
- postgres_password_secret
env_file:
- .env.backend

dashboard:
build:
context: .
Expand Down