feat(compose): services listen on their configured port, publishing is commented out with a random host port
This commit is contained in:
1 parent
b4125407bf
commit
2c1dfefe34
4 files changed
+27
-15
No files matched your search
@@ -50,18 +50,18 @@ services:
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: ${DB__USER}
|
||||
MONGO_INITDB_ROOT_PASSWORD: ${DB__PASSWORD}
|
||||
command: mongod --port ${DB__PORT:-27017}
|
||||
command: mongod --port ${DB__PORT}
|
||||
volumes:
|
||||
- database:/data/db
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--quiet", "--port", "${DB__PORT:-27017}", "--eval", "db.adminCommand('ping')"]
|
||||
test: ["CMD", "mongosh", "--quiet", "--port", "${DB__PORT}", "--eval", "db.adminCommand('ping')"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
database:
|
||||
aliases:
|
||||
- ${DB__HOST:-mongodb}
|
||||
- ${DB__HOST}
|
||||
{% endif %}
|
||||
{%- if database == 'postgres' %}
|
||||
postgres:
|
||||
@@ -72,6 +72,7 @@ services:
|
||||
POSTGRES_USER: ${DB__USER}
|
||||
POSTGRES_PASSWORD: ${DB__PASSWORD}
|
||||
POSTGRES_DB: ${DB__DB_NAME}
|
||||
PGPORT: ${DB__PORT}
|
||||
volumes:
|
||||
- database:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
@@ -82,7 +83,7 @@ services:
|
||||
networks:
|
||||
database:
|
||||
aliases:
|
||||
- ${DB__HOST:-postgres}
|
||||
- ${DB__HOST}
|
||||
|
||||
migrator:
|
||||
build: {{ part_dir }}
|
||||
@@ -114,9 +115,9 @@ services:
|
||||
image: redis:7-alpine
|
||||
profiles: [redis, external]
|
||||
restart: unless-stopped
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
command: ["redis-server", "--port", "${REDIS__PORT}", "--appendonly", "yes"]
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
test: ["CMD", "redis-cli", "-p", "${REDIS__PORT}", "ping"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -125,7 +126,7 @@ services:
|
||||
networks:
|
||||
redis:
|
||||
aliases:
|
||||
- ${REDIS__HOST:-redis}
|
||||
- ${REDIS__HOST}
|
||||
{% endif %}
|
||||
{%- if database != 'none' or use_redis %}
|
||||
volumes:
|
||||
|
||||
Reference in new issue
Block a user