diff --git a/.github/workflows/admin_bot-ci.yml b/.github/workflows/admin_bot-ci.yml index 81766b6..3e81da0 100644 --- a/.github/workflows/admin_bot-ci.yml +++ b/.github/workflows/admin_bot-ci.yml @@ -63,7 +63,6 @@ jobs: build-and-publish-image: name: Build Registry runs-on: ubuntu-latest - needs: [formatblack] # Keeps the bot from updating the image if its not tested/formatted permissions: contents: read @@ -129,7 +128,7 @@ jobs: gcr-cleaner: runs-on: "ubuntu-latest" - # needs: [build-and-publish-image] + needs: [build-and-publish-image] steps: - name: Clean adminbot diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index e7a2d4b..b393989 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -1,19 +1,24 @@ -version: '3.7' +version: "3.7" services: - database: + db: image: postgres:10.5 restart: always environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=admin_bot_db + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 10s + timeout: 5s + retries: 5 logging: options: max-size: 10m max-file: "3" ports: - - '5438:5432' + - "5438:5432" volumes: - ./postgres-data:/var/lib/postgresql/data networks: @@ -23,15 +28,39 @@ services: image: ghcr.io/frc-1721/adminbot:main environment: BOT_TOKEN: "secret.token.here" - devices: - - "/dev/video0:/dev/video0" - networks: - - dbnet depends_on: - - database + db: + condition: service_healthy + volumes: + - promo:/app/promo + links: + - "db:database" + - "admin_interface:interface" restart: "always" command: "true" -networks: - dbnet: - driver: bridge + admin_interface: + image: ghcr.io/frc-1721/admininterface:main + volumes: + - promo:/app/admin_interface/static/promo + environment: + LOG_LEVEL: "DEBUG" + TZ: "America/New_York" + ports: + - 8000:8000 + restart: "always" + + watchtower: + image: containrrr/watchtower + environment: + WATCHTOWER_NOTIFICATIONS: shoutrrr + WATCHTOWER_NOTIFICATION_URL: "discord://mK0Opd9ov35Z61mzLFympguG8QgyDtEbNcOhfde-b7A7ti4VbTpgaXoz9aSiYm0mKOjF@886982405058088980" + WATCHTOWER_NOTIFICATION_TEMPLATE: '{{range .}}{{.Time.Format "2006-01-02 15:04:05"}} ({{.Level}}): {{.Message}}{{println}}{{end}}' + volumes: + - /var/run/docker.sock:/var/run/docker.sock + restart: "always" + command: --interval 120 + +# Docker Volumes +volumes: + promo: diff --git a/docker-compose.yml b/docker-compose.yml index 3d4907e..f3a01ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,9 +42,6 @@ services: admin_interface: image: admin_interface:$TAG - depends_on: - db: - condition: service_healthy build: context: admin_interface/ dockerfile: Dockerfile