-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated docker compose configuration not to use configs but volumes t…
…o not require swarm mode
- Loading branch information
1 parent
a3750bf
commit 3d42e35
Showing
5 changed files
with
68 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,39 @@ | ||
version: '3.8' # Specify Docker Compose version | ||
|
||
services: | ||
postgres: | ||
image: postgres:15.1-alpine | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_USER=postgres | ||
command: | ||
- "postgres" | ||
- "-c" | ||
- "wal_level=logical" | ||
- "-c" | ||
- "wal_compression=on" | ||
volumes: | ||
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
|
||
pgadmin: #http://localhost:5050 | ||
container_name: pgadmin_container | ||
image: dpage/pgadmin4 | ||
environment: | ||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org} | ||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-postgres} | ||
- PGADMIN_CONFIG_SERVER_MODE=False | ||
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False | ||
ports: | ||
- "${PGADMIN_PORT:-5050}:80" | ||
entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;" | ||
user: root | ||
configs: | ||
- source: servers.json | ||
target: /pgadmin4/servers.json | ||
- source: pgpass | ||
target: /pgpass | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
postgres: | ||
image: postgres:15.1-alpine | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_USER=postgres | ||
command: | ||
- "postgres" | ||
- "-c" | ||
- "wal_level=logical" | ||
- "-c" | ||
- "wal_compression=on" | ||
volumes: | ||
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
|
||
pgadmin: | ||
container_name: pgadmin_container | ||
image: dpage/pgadmin4 | ||
environment: | ||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org} | ||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-postgres} | ||
- PGADMIN_CONFIG_SERVER_MODE=False | ||
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False | ||
ports: | ||
- "${PGADMIN_PORT:-5050}:80" | ||
entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;" | ||
user: root | ||
volumes: | ||
- ./docker/pgAdmin/pgpass:/pgpass | ||
- ./docker/pgAdmin/servers.json:/pgadmin4/servers.json | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
|
||
configs: | ||
pgpass: | ||
content: postgres:5432:*:postgres:postgres | ||
servers.json: | ||
content: | | ||
{"Servers": {"1": { | ||
"Group": "Servers", | ||
"Name": "docker_postgres", | ||
"Host": "postgres", | ||
"Port": 5432, | ||
"MaintenanceDB": "postgres", | ||
"Username": "postgres", | ||
"PassFile": "/pgpass", | ||
"SSLMode": "prefer" | ||
}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
postgres:5432:*:postgres:postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Servers": { | ||
"1": { | ||
"Group": "Servers", | ||
"Name": "docker_postgres", | ||
"Host": "postgres", | ||
"Port": 5432, | ||
"MaintenanceDB": "postgres", | ||
"Username": "postgres", | ||
"PassFile": "/pgpass", | ||
"SSLMode": "prefer" | ||
} | ||
} | ||
} |
File renamed without changes.