Skip to content

Commit

Permalink
Adjusting extensions and container
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreniche committed Feb 27, 2024
1 parent 8bab75e commit a02be70
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
},
Expand Down
48 changes: 25 additions & 23 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
- [email protected]
- PGADMIN_DEFAULT_PASSWORD=password
image: dpage/pgadmin4:6.10
restart: unless-stopped
volumes:
- ./pgadmin:/var/lib/pgadmin
- pgadmin-data:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
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: {}

0 comments on commit a02be70

Please sign in to comment.