Skip to content

Commit

Permalink
fix: okay i have learned how env vars work. you cannot set 'environme…
Browse files Browse the repository at this point in the history
…nt:' vars using vars from 'env_file'
  • Loading branch information
tefkah committed Feb 18, 2025
1 parent 8b2f9e4 commit 29d413f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
17 changes: 15 additions & 2 deletions .env.docker-compose.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MINIO_ACCESS_KEY=pubpub-minio-admin
MINIO_SECRET_KEY=pubpub-minio-admin
MINIO_ROOT_USER=pubpub-minio-admin
MINIO_ROOT_PASSWORD=pubpub-minio-admin

ASSETS_BUCKET_NAME=byron.v7.pubpub.org
ASSETS_UPLOAD_KEY=pubpubuserrr
Expand All @@ -13,6 +13,19 @@ POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOST=db

# annoying duplication because jobs uses this version
PGHOST=db
PGPORT=5432
PGUSER=postgres
PGPASSWORD=postgres
PGDATABASE=postgres

# this needs to be db:5432 bc that's what it is in the app-network
# if you are running this from outside the docker network, you need to use
# @localhost:${POSTGRES_PORT} instead
DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres


JWT_SECRET=xxx
MAILGUN_SMTP_PASSWORD=xxx
GCLOUD_KEY_FILE=xxx
Expand Down
7 changes: 0 additions & 7 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ services:
start_period: 30s
restart: unless-stopped
command: server --console-address ":9001" /data
environment:
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY}
- MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY}
ports:
- "9000:9000" # API
- "9001:9001" # Console
Expand All @@ -36,10 +33,6 @@ services:
db:
image: postgres:15
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}

inbucket:
image: inbucket/inbucket:latest
Expand Down
34 changes: 6 additions & 28 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ services:
extends:
file: ./docker-compose.base.yml
service: db
env_file:
- path: .env.docker-compose.test
required: true
env_file: ./.env.docker-compose.test
volumes:
- postgres_test_data:/var/lib/postgresql/data
networks:
Expand All @@ -22,9 +20,7 @@ services:
extends:
file: ./docker-compose.base.yml
service: minio
env_file:
- path: .env.docker-compose.test
required: true
env_file: ./.env.docker-compose.test
volumes:
- minio_data:/data
networks:
Expand All @@ -36,9 +32,7 @@ services:
depends_on:
minio:
condition: service_healthy
env_file:
- path: .env.docker-compose.test
required: true
env_file: ./.env.docker-compose.test
extends:
file: ./docker-compose.base.yml
service: minio-init
Expand All @@ -51,9 +45,7 @@ services:
extends:
file: ./docker-compose.base.yml
service: inbucket
env_file:
- path: .env.docker-compose.test
required: true
env_file: ./.env.docker-compose.test
networks:
- app-network
profiles:
Expand All @@ -64,17 +56,9 @@ services:
container_name: jobs
image: ${JOBS_IMAGE}
platform: linux/amd64
env_file:
- path: .env.docker-compose.test
required: true
env_file: .env.docker-compose.test
environment:
- OTEL_SERVICE_NAME=jobs.jobs
- PGDATABASE=${POSTGRES_DB}
- PGHOST=db
- PGPORT=${POSTGRES_PORT}
- PGUSER=${POSTGRES_USER}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PUBPUB_URL=http://localhost:3000
networks:
- app-network
depends_on:
Expand All @@ -84,14 +68,8 @@ services:

integration-tests:
image: ${INTEGRATION_TESTS_IMAGE}
env_file:
- path: .env.docker-compose.test
required: true
env_file: ./.env.docker-compose.test
environment:
# this needs to be db:5432 bc that's what it is in the app-network
# if you are running this from outside the docker network, you need to use
# @localhost:${POSTGRES_PORT} instead
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
- PORT=3000
- CI=true
depends_on:
Expand Down

0 comments on commit 29d413f

Please sign in to comment.