Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Add docker compose file with PostgreSQL included #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ docker run -it --env DBPASS="<PASSWORD>" --env DBHOST="<SERVER_HOST_NAME>" --env
```
The app can be reached in your browser at `http://127.0.0.1:5000`.

## Docker compose with PostgreSQL

You also can use the docker compose file to spin up the Python Flask application and a PostgreSQL docker container. The database connection information will be passed automatically within the docker compose file.

```
docker-compose build
docker-compose up
```

# Contributing

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'
services:
flask-sample:
build: .
depends_on:
- db
ports:
- "5000:5000"
environment:
- DBUSER=postgres
- DBPASS=changeme
- DBHOST=db
- DBNAME=postgres
db:
image: postgres:10
restart: always
environment:
POSTGRES_PASSWORD: changeme