From 29787f17aa98aaaf0d4193c42784f596078c55cf Mon Sep 17 00:00:00 2001 From: Pingu Date: Wed, 8 Mar 2023 19:47:26 +0100 Subject: [PATCH] So that we can host it --- .github/workflows/publish-docker-image.yml | 43 ++++++++++++++++++++++ docker-compose.yml | 17 +++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-docker-image.yml diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml new file mode 100644 index 0000000..56fe957 --- /dev/null +++ b/.github/workflows/publish-docker-image.yml @@ -0,0 +1,43 @@ +name: Publish Docker Image + +on: + release: + types: [ published ] + +env: + # GitHub repository is basically "$org/$repo" + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + # User triggering the action is authenticated to the container registry + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Basically sets the image tag from the release + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/docker-compose.yml b/docker-compose.yml index 49be134..0eba2f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,19 @@ -version: '2' +version: '3.7' services: web: build: . command: npm start container_name: dudsman - ports: - - '43625:3000' + restart: unless-stopped + expose: + - 3000 + networks: + - ingress + labels: + traefik.docker.network: dudsman.tratt6.party-ingress + traefik.http.routers.dudsman_tratt6_party.rule: Host(`dudsman.tratt6.party`) + traefik.http.routers.dudsman_tratt6_party.middlewares: https@file + +networks: + ingress: + name: dudsman.tratt6.party-ingress