From 16e9e0f10761e9a96e6aac94d6fdaae5b3d4a85f Mon Sep 17 00:00:00 2001 From: Michael Haufe Date: Fri, 26 Jul 2024 18:20:20 -0500 Subject: [PATCH 1/2] 201 configure azure infrastructure (#250) * chore: Update compose.yml with environment variables for NUXT_HOST and NUXT_PORT --- compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compose.yml b/compose.yml index f7d9c535..67a01189 100644 --- a/compose.yml +++ b/compose.yml @@ -21,6 +21,9 @@ services: volumes: - ${WEBAPP_STORAGE_HOME}/site/wwwroot:/home/site/wwwroot command: node /home/site/wwwroot/server/index.mjs + environment: + NUXT_HOST: 0.0.0.0 + NUXT_PORT: 3000 ports: - 443:3000 From 1868cf88e22d76862a2e7b7816367742cfa026bd Mon Sep 17 00:00:00 2001 From: Michael Haufe Date: Fri, 26 Jul 2024 19:55:46 -0500 Subject: [PATCH 2/2] 201 configure azure infrastructure (#251) - Fixed regression in local development due to config changes. - updated postgres volume reference - updated production network settings --- .devcontainer/compose.extend.yml | 14 +++++++++++++- .devcontainer/devcontainer.json | 3 +++ .env.example | 2 +- CONTRIBUTING.md | 4 ++-- compose.yml | 15 ++++++++++----- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.devcontainer/compose.extend.yml b/.devcontainer/compose.extend.yml index b635231f..df50a411 100644 --- a/.devcontainer/compose.extend.yml +++ b/.devcontainer/compose.extend.yml @@ -2,6 +2,8 @@ services: db: volumes: - postgres-data:/var/lib/postgresql/data + networks: + - app-network web: image: node:22.5.1-bookworm depends_on: @@ -12,5 +14,15 @@ services: - .:/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" + ports: + - 3000:3000 + environment: + NUXT_HOST: 0.0.0.0 + NUXT_PORT: 3000 + networks: + - app-network # 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 + +networks: + app-network: \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 36090375..1ebd4ae7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,6 +6,9 @@ "../compose.yml", "compose.extend.yml" ], + "forwardPorts": [ + 5432 + ], "service": "web", "workspaceFolder": "/workspace/${localWorkspaceFolderBasename}", "shutdownAction": "stopCompose", diff --git a/.env.example b/.env.example index a8402842..7655331c 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres -POSTGRES_HOST: localhost +POSTGRES_HOST: db POSTGRES_PORT: 5432 POSTGRES_DB: cathedral GH_CLIENT_ID: Ov23lij8q5YhcosEjIzQ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc298e57..62403014 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,9 +33,9 @@ There are a number of commands defined in `package.json` that can be run to popu ## Running the project -The project can be run in debug mode via: `npm run dev` +The project can be run in debug mode via: `npm run dev`. You can then access the application at `http://localhost:3000`. -A production build can be run via: `npm run build` followed by `npm run preview` +A production build can be run via: `npm run build` followed by `npm run preview`. You can then access the application at `http://localhost:3000`. ## Application Infrastructure diff --git a/compose.yml b/compose.yml index 67a01189..206fc0bf 100644 --- a/compose.yml +++ b/compose.yml @@ -6,18 +6,18 @@ services: - 5432:5432 volumes: # - ${WEBAPP_STORAGE_HOME}/pgdata:/var/lib/postgresql/data - - db-data:/var/lib/postgresql/data + - postgres-data:/var/lib/postgresql/data environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} + networks: + - app-network web: image: node:22.5.1-bookworm depends_on: - db restart: unless-stopped - # puts the Dev Container on the same network as the database, so that it can access it on localhost - network_mode: service:db volumes: - ${WEBAPP_STORAGE_HOME}/site/wwwroot:/home/site/wwwroot command: node /home/site/wwwroot/server/index.mjs @@ -26,7 +26,12 @@ services: NUXT_PORT: 3000 ports: - 443:3000 + networks: + - app-network volumes: - db-data: - driver: local \ No newline at end of file + postgres-data: + driver: local + +networks: + app-network: