-
Notifications
You must be signed in to change notification settings - Fork 71
first commit #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
first commit #177
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,37 +1,41 @@ | ||||||||||
| services: | ||||||||||
| db: | ||||||||||
| image: postgres:15 | ||||||||||
| container_name: volunchain_db | ||||||||||
| container_name: ${DB_CONTAINER_NAME:-volunchain_db} | ||||||||||
| environment: | ||||||||||
| POSTGRES_USER: volunchain | ||||||||||
| POSTGRES_PASSWORD: volunchain123 | ||||||||||
| POSTGRES_DB: volunchain | ||||||||||
| POSTGRES_USER: ${POSTGRES_USER:-volunchain} | ||||||||||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-volunchain123} | ||||||||||
| POSTGRES_DB: ${POSTGRES_DB:-volunchain} | ||||||||||
| ports: | ||||||||||
| - "5434:5432" # O usa "5432:5432" si necesitas que coincida localmente | ||||||||||
| - "${DB_HOST_PORT:-5434}:5432" | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Bind services to localhost to avoid exposing them on all interfaces. Limit DB/Redis exposure to the host only. - - "${DB_HOST_PORT:-5434}:5432"
+ - "127.0.0.1:${DB_HOST_PORT:-5434}:5432"- - "${REDIS_HOST_PORT:-6379}:6379"
+ - "127.0.0.1:${REDIS_HOST_PORT:-6379}:6379"Also applies to: 23-23 π€ Prompt for AI Agents |
||||||||||
| volumes: | ||||||||||
| - db_data:/var/lib/postgresql/data | ||||||||||
| healthcheck: | ||||||||||
| test: ["CMD-SHELL", "pg_isready -U volunchain"] | ||||||||||
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-volunchain}"] | ||||||||||
| interval: 5s | ||||||||||
| retries: 5 | ||||||||||
| timeout: 5s | ||||||||||
|
|
||||||||||
| redis: | ||||||||||
| image: redis:latest | ||||||||||
| container_name: volunchain_redis | ||||||||||
| container_name: ${REDIS_CONTAINER_NAME:-volunchain_redis} | ||||||||||
| ports: | ||||||||||
| - "6379:6379" | ||||||||||
| - "${REDIS_HOST_PORT:-6379}:6379" | ||||||||||
|
|
||||||||||
| app: | ||||||||||
| build: . | ||||||||||
| container_name: volunchain_app | ||||||||||
| container_name: ${APP_CONTAINER_NAME:-volunchain_app} | ||||||||||
| environment: | ||||||||||
| DATABASE_URL: postgres://volunchain:volunchain123@db:5432/volunchain | ||||||||||
| REDIS_URL: redis://redis:6379 | ||||||||||
| DATABASE_URL: postgres://${POSTGRES_USER:-volunchain}:${POSTGRES_PASSWORD:-volunchain123}@db:5432/${POSTGRES_DB:-volunchain} | ||||||||||
| REDIS_URL: redis://redis:6379 | ||||||||||
| command: sh -c "./entrypoint.sh" | ||||||||||
| depends_on: | ||||||||||
| db: | ||||||||||
| condition: service_healthy | ||||||||||
| redis: | ||||||||||
| condition: service_started | ||||||||||
|
|
||||||||||
| volumes: | ||||||||||
| db_data: | ||||||||||
| docker-compose.yml | ||||||||||
| git switch -c feature/docker-variables | ||||||||||
|
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove stray, non-YAML lines breaking the compose file. These two lines are literal text inside the YAML and cause the syntax error flagged by yamllint. Delete them. volumes:
db_data:
-docker-compose.yml
-git switch -c feature/docker-variablesπ Committable suggestion
Suggested change
π§° Toolsπͺ YAMLlint (1.37.1)[error] 41-41: syntax error: could not find expected ':' (syntax) π€ Prompt for AI Agents |
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
Avoid shipping default credentials; require them via .env.
Defaulting POSTGRES_PASSWORD (and embedding it in DATABASE_URL) is a security smell. Make the password required and document it in .env.example.
POSTGRES_USER: ${POSTGRES_USER:-volunchain} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-volunchain123} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set in .env} POSTGRES_DB: ${POSTGRES_DB:-volunchain}Optional: switch to
env_file: .envand add a committed.env.example.Also applies to: 29-29
π€ Prompt for AI Agents