diff --git a/.devcontainer/compose.extend.yml b/.devcontainer/compose.extend.yml index 599b82e0..fedbe585 100644 --- a/.devcontainer/compose.extend.yml +++ b/.devcontainer/compose.extend.yml @@ -1,4 +1,7 @@ services: + db: + volumes: + - postgres-data:/var/lib/postgresql/data web: image: node:22.5.1-bookworm depends_on: @@ -10,4 +13,7 @@ services: # Overrides default command so things don't shut down after the process ends. command: /bin/sh -c "while sleep 1000; do :; done" # puts the Dev Container on the same network as the database, so that it can access it on localhost - network_mode: service:db \ No newline at end of file + network_mode: service:db + +volumes: + postgres-data: \ No newline at end of file diff --git a/.github/workflows/azure-infra.yml b/.github/workflows/azure-infra.yml index f866ef1b..dba52019 100644 --- a/.github/workflows/azure-infra.yml +++ b/.github/workflows/azure-infra.yml @@ -24,12 +24,6 @@ jobs: - name: Lint Bicep run: | az bicep build --file ./azure/bicep/main.bicep - - name: Convert compose.yml to base64 - id: convert_compose - run: | - base64 ./compose.yml > compose.base64 - base64Compose=$(cat compose.base64) - echo "::set-output name=base64Compose::$base64Compose" - name: Run what-if uses: azure/arm-deploy@v2 with: @@ -46,7 +40,6 @@ jobs: postgresPassword=${{ secrets.POSTGRES_PASSWORD }} postgresPort=${{ secrets.POSTGRES_PORT }} postgresUser=${{ secrets.POSTGRES_USER }} - base64Compose=${{ steps.convert_compose.outputs.base64Compose }} scope: 'resourcegroup' deploymentMode: 'Incremental' failOnStdErr: false @@ -64,12 +57,6 @@ jobs: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Convert compose.yml to base64 - id: convert_compose - run: | - base64 ./compose.yml > compose.base64 - base64Compose=$(cat compose.base64) - echo "::set-output name=base64Compose::$base64Compose" - name: Deploy Bicep uses: azure/arm-deploy@v2 with: @@ -88,6 +75,5 @@ jobs: postgresPassword=${{ secrets.POSTGRES_PASSWORD }} postgresPort=${{ secrets.POSTGRES_PORT }} postgresUser=${{ secrets.POSTGRES_USER }} - base64Compose=${{ steps.convert_compose.outputs.base64Compose }} scope: 'resourcegroup' failOnStdErr: false diff --git a/azure/bicep/main.bicep b/azure/bicep/main.bicep index 6b50257f..c6f9dfeb 100644 --- a/azure/bicep/main.bicep +++ b/azure/bicep/main.bicep @@ -6,7 +6,8 @@ param location string = resourceGroup().location @minLength(3) @maxLength(22) param name string = 'cathedral' -param base64Compose string + +var base64Compose = loadFileAsBase64('../../compose.yml') @secure() param authOrigin string diff --git a/compose.yml b/compose.yml index da57d618..44b57612 100644 --- a/compose.yml +++ b/compose.yml @@ -5,7 +5,7 @@ services: ports: - 5432:5432 volumes: - - postgres-data:/var/lib/postgresql/data + - ${WEBAPP_STORAGE_HOME}/pgdata:/var/lib/postgresql/data environment: PGDATA: /var/lib/postgresql/data/pgdata POSTGRES_USER: ${POSTGRES_USER} @@ -16,13 +16,7 @@ services: depends_on: - db restart: unless-stopped - # mounts the workspace folder from the local source tree into the Dev Container. - # volumes: - # - .:/workspace/cathedral:cached # Overrides default command so things don't shut down after the process ends. command: /bin/sh -c "while sleep 1000; do :; done" # puts the Dev Container on the same network as the database, so that it can access it on localhost - network_mode: service:db - -volumes: - postgres-data: + network_mode: service:db \ No newline at end of file