diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64d8f44..285b8f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,54 +24,14 @@ jobs: uses: CultureHQ/actions-yarn@master with: args: --cwd services/bot install - - name: Build and publish qutex_bot - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_bot - extract-git-tag: true - build-context: ./services/bot - dockerfile: ./services/bot/Dockerfile - - name: Build and publish qutex_nginx - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_nginx - extract-git-tag: true - build-context: ./services/nginx - dockerfile: ./services/nginx/Dockerfile - - name: Build and publish qutex_ui - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_ui - extract-git-tag: true - build-context: ./services/ui - dockerfile: ./services/ui/Dockerfile - - name: Build and publish qutex_projects - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_projects - extract-git-tag: true - build-context: . - dockerfile: ./services/_api_service_template/Dockerfile - custom-args: --build-arg SERVICE_PREFIX=projects - - name: Build and publish qutex_users - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_users - extract-git-tag: true - build-context: . - dockerfile: ./services/_api_service_template/Dockerfile - custom-args: --build-arg SERVICE_PREFIX=users - - name: Build and publish qutex_auth - uses: VaultVulp/gp-docker-action@1.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - image-name: qutex_auth - extract-git-tag: true - build-context: . - dockerfile: ./services/_api_service_template/Dockerfile - custom-args: --build-arg SERVICE_PREFIX=auth \ No newline at end of file + - name: Build & push containers + run: | + # Setup Build + docker login -u publisher -p ${DOCKER_TOKEN} ghcr.io + QUTEX_VERSION=$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g") + + # Build all containers + docker compose -f docker-compose.build.yml build + docker compose -f docker-compose.build.yml push + env: + DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 0000000..1766bae --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,35 @@ +version: '3.9' +services: + nginx: + image: ghcr.io/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest} + build: + context: services/nginx + bot: + image: ghcr.io/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest} + build: + context: ./services/bot + ui: + image: ghcr.io/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest} + build: + context: services/ui/ + projects: + image: ghcr.io/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest} + build: + context: . + dockerfile: services/_api_service_template/Dockerfile + args: + SERVICE_PREFIX: projects + users: + image: ghcr.io/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest} + build: + context: . + dockerfile: services/_api_service_template/Dockerfile + args: + SERVICE_PREFIX: users + auth: + image: ghcr.io/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest} + build: + context: . + dockerfile: services/_api_service_template/Dockerfile + args: + SERVICE_PREFIX: auth \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5a6ee5a..ea7850b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ x-common: &common services: nginx: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_nginx:${QUTEX_VERSION:-latest} depends_on: - web - auth @@ -17,7 +17,7 @@ services: - 80:80 bot: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest} depends_on: - mongo ports: @@ -29,7 +29,7 @@ services: - mongoPassword ui: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_ui:${QUTEX_VERSION:-latest} depends_on: - mongo - bot @@ -38,7 +38,7 @@ services: context: services/ui/ projects: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_projects:${QUTEX_VERSION:-latest} depends_on: - mongo - auth @@ -46,7 +46,7 @@ services: - mongoPassword users: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_users:${QUTEX_VERSION:-latest} depends_on: - auth secrets: @@ -54,7 +54,7 @@ services: - mongoPassword auth: <<: *common - image: docker.pkg.github.com/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_auth:${QUTEX_VERSION:-latest} depends_on: - redis - mongo @@ -68,7 +68,7 @@ services: migrate: depends_on: - mongo - image: docker.pkg.github.com/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest} + image: ghcr.io/amthorn/qutex/qutex_bot:${QUTEX_VERSION:-latest} env_file: *env_files secrets: - mongoPassword diff --git a/services/_api_service_template/Dockerfile b/services/_api_service_template/Dockerfile index 685f29d..7044381 100644 --- a/services/_api_service_template/Dockerfile +++ b/services/_api_service_template/Dockerfile @@ -12,9 +12,7 @@ WORKDIR /qutex COPY services/_api_service_template/src . # Copy service-specific files -COPY services/${SERVICE_PREFIX}/api/ ./api/ -COPY services/${SERVICE_PREFIX}/documents ./documents -COPY services/${SERVICE_PREFIX}/*.py ./ +COPY services/${SERVICE_PREFIX}/* ./ ENV SERVICE_PREFIX=${SERVICE_PREFIX} ENTRYPOINT ["flask", "run", "--host=0.0.0.0", "--port=4000"]