From a02be70708402b2935e377e8ea5bd75d22bd16fe Mon Sep 17 00:00:00 2001 From: Diego Freniche Date: Tue, 27 Feb 2024 09:52:32 +0000 Subject: [PATCH] Adjusting extensions and container --- .devcontainer/devcontainer.json | 4 ++- .devcontainer/docker-compose.yml | 48 +++++++++++++++++--------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1e88a9f..26faf4f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,9 @@ "vscode": { // Add the IDs of extensions you want installed when the container is created. "extensions": [ - "mongodb.mongodb-vscode" + "mongodb.mongodb-vscode", + "ckolkman.vscode-postgres", + "ms-azuretools.vscode-docker" ] } }, diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 47c1797..a084728 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,29 +1,31 @@ version: "3.9" services: postgresql: - image: postgres:14 + image: postgres:latest + restart: unless-stopped + volumes: + - postgres-data:/var/lib/postgresql/data environment: - # - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=password - - POSTGRES_DB=library - ports: - - "5432:5432" - healthcheck: # we use this in pgadmin to wait for PostgreSQL to start - test: su -c 'pg_isready' postgres - interval: 10s - timeout: 3s - retries: 3 - start_period: 2s - # web interface to admin Postgres + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally. + # (Adding the "ports" property to this file will not forward from a Codespace.) + pgadmin: - image: dpage/pgadmin4:latest - ports: - - 8080:80 - depends_on: - postgresql: - condition: service_healthy - environment: # add connection to postgresql - - PGADMIN_DEFAULT_EMAIL=sql@mongodb.com - - PGADMIN_DEFAULT_PASSWORD=password + image: dpage/pgadmin4:6.10 + restart: unless-stopped volumes: - - ./pgadmin:/var/lib/pgadmin \ No newline at end of file + - pgadmin-data:/var/lib/pgadmin + environment: + PGADMIN_DEFAULT_EMAIL: jonhdoe@gmail.com + PGADMIN_DEFAULT_PASSWORD: StrongPassword + PGADMIN_LISTEN_PORT: 8080 + PGADMIN_CONFIG_PROXY_X_HOST_COUNT: 1 + PGADMIN_CONFIG_PROXY_X_PREFIX_COUNT: 1 + ports: + - "8080:8080" + +volumes: + postgres-data: {} + pgadmin-data: {} \ No newline at end of file