Skip to content

Commit

Permalink
Merge pull request #53 from esnet-security/topic/soehlert/production_…
Browse files Browse the repository at this point in the history
…postgres_optional

fix(postgres_container): Don't spin up a postgres container in prod by default
  • Loading branch information
samoehlert authored Oct 17, 2024
2 parents fee72a7 + 7cdf074 commit 20d2faf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ pytest:
image: docker:24.0.6-dind
services:
- docker:dind
variables:
POSTGRES_ENABLED: 1
before_script:
- apk add make
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
Expand Down
2 changes: 2 additions & 0 deletions compose.override.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ services:
- production_postgres_data_backups:/backups:z
env_file:
- ./.envs/.production/.postgres
deploy:
replicas: 0

nginx:
image: nginx:1.19
Expand Down
3 changes: 2 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ services:
- net.ipv6.conf.all.disable_ipv6=0
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
deploy:
replicas: ${POSTGRES_ENABLED:-0}

redis:
image: redis:5.0
Expand Down Expand Up @@ -64,4 +66,3 @@ services:
default: {}
sysctls:
- net.ipv6.conf.all.disable_ipv6=0

0 comments on commit 20d2faf

Please sign in to comment.