Skip to content

Commit

Permalink
Merge pull request #2 from moevm/add_docker
Browse files Browse the repository at this point in the history
add postgres and data seed
  • Loading branch information
VovaBas04 authored Oct 16, 2024
2 parents 3eb310e + d73f406 commit 1db02eb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hello_world/.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ MONGO_INITDB_ROOT_PASSWORD=password
MONGO_INITDB_PORT=27017
MONGO_INITDB_HOST=db
MONGO_INITDB_DATABASE=quotes
POSTGRES_INITDB_PORT=5432
POSTGRES_INITDB_HOST=db_postgres
POSTGRES_INITDB_ROOT_USERNAME=root
POSTGRES_INITDB_USERNAME=classic
POSTGRES_INITDB_ROOT_PASSWORD=password
POSTGRES_INITDB_DB_NAME=quotes
18 changes: 18 additions & 0 deletions hello_world/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,26 @@ services:
- db-data:/data/db
networks:
- docker_network
db_postgres:
container_name: postgres_db
env_file:
- .env
environment:
POSTGRES_INITDB_ROOT_USERNAME: ${POSTGRES_INITDB_ROOT_USERNAME}
POSTGRES_INITDB_ROOT_PASSWORD: ${POSTGRES_INITDB_ROOT_PASSWORD}
POSTGRES_USER: ${POSTGRES_INITDB_USERNAME}
POSTGRES_PASSWORD: ${POSTGRES_INITDB_ROOT_PASSWORD}
POSTGRES_DB: ${POSTGRES_INITDB_DB_NAME}
image: postgres:latest
ports:
- ${POSTGRES_INITDB_PORT}:${POSTGRES_INITDB_PORT}
volumes:
- db-data-postgres:/data/db
networks:
- docker_network

volumes:
db-data:
db-data-postgres:
networks:
docker_network:
Empty file added hello_world/quotes.json
Empty file.

0 comments on commit 1db02eb

Please sign in to comment.