Skip to content

Commit

Permalink
fix: now use .env.example prior to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
electronyoon committed Feb 16, 2025
1 parent 6ab364d commit e452e82
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
"installGradle": true
}
},
"forwardPorts": [8080, 5432],
"onCreateCommand": "cp .env.example .env"
"forwardPorts": [8080, 5432]
}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.PHONY: local up down clean localdb

local:
docker-compose --env-file .env -f docker-compose.yml -f docker-compose.local.yml build --no-cache
docker-compose -f docker-compose.yml -f docker-compose.local.yml build --no-cache

up:
docker-compose --env-file .env -f docker-compose.yml -f docker-compose.local.yml up
docker-compose -f docker-compose.yml -f docker-compose.local.yml up

# prod:
# ...
Expand All @@ -17,4 +17,4 @@ clean: down
docker system prune -f

localdb:
docker-compose --env-file .env -f docker-compose.yml -f docker-compose.local.yml up -d db
docker-compose -f docker-compose.yml -f docker-compose.local.yml up -d db
2 changes: 0 additions & 2 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

networks:
zipsoon-network:
driver: bridge
Expand Down
12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
version: "3.9"
x-env-files: &env-files
env_file:
- .env.example
- .env

services:
db:
<<: *env-files

batch:
build:
context: .
dockerfile: batch/Dockerfile
<<: *env-files

api:
build:
context: .
dockerfile: api/Dockerfile
dockerfile: api/Dockerfile
<<: *env-files

0 comments on commit e452e82

Please sign in to comment.