https://github.com/xnuinside/python-docker-sample
Simple Python Server with connection to DB in docker-compose
https://github.com/xnuinside/python-docker-sample
Last synced: about 1 year ago
JSON representation
Simple Python Server with connection to DB in docker-compose
- Host: GitHub
- URL: https://github.com/xnuinside/python-docker-sample
- Owner: xnuinside
- Created: 2021-02-09T09:04:03.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-09T10:03:42.000Z (over 5 years ago)
- Last Synced: 2025-02-12T22:17:39.213Z (over 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Simple Python project as Example Python in Docker-Compose
Runs DB & python server with connection to DB
If all ok - you will see a print with Success message like 'Connected to PostgreSQL'.
DB settings stored as environment variables:
- DB_PASS
- DB_LOGIN
- DB_HOST
- DB_PORT
- DB_NAME
To test, what you can access server from localhost send get request to '/ping' endpoint, like:
http://0.0.0.0:8080/ping
Answer will be 'pong'.
### How to use
```bash
git clone https://github.com/xnuinside/python-docker-sample.git
cd python-docker-sample
docker-compose up --build
```