Created
May 13, 2019 22:16
-
-
Save marcelobbfonseca/071339e88a361d751095dd357ccf3e3b to your computer and use it in GitHub Desktop.
Both Dockerfile and docker-compose example files for a regular python Flask and postgresql environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
postgres: | |
image: postgres:10 | |
restart: always | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: postgres | |
POSTGRES_PASSWORD: secret | |
ports: | |
- "5432:5432" | |
volumes: | |
- ./postgres-data/postgres:/var/lib/postgresql/data | |
app: | |
build: . | |
volumes: | |
- .:/code # for development only | |
ports: | |
- "5000:5000" | |
depends_on: | |
- postgres | |
entrypoint: ["python", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7.3-stretch | |
RUN mkdir /code | |
WORKDIR /code | |
COPY requirements.txt /code/ | |
RUN pip install -r requirements.txt | |
COPY . /code/ | |
EXPOSE 5000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment