Skip to content

Commit dee22cb

Browse files
committed
all the dockerfile gubbins
1 parent 0d226dd commit dee22cb

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.7-alpine
2+
3+
RUN apk add --no-cache --virtual .build-deps gcc postgresql-dev musl-dev python3-dev
4+
RUN apk add libpq
5+
6+
COPY requirements.txt /tmp
7+
RUN pip install -r /tmp/requirements.txt
8+
9+
RUN apk del --no-cache .build-deps
10+
11+
RUN mkdir -p /code
12+
COPY *.py /code/
13+
WORKDIR /code
14+
ENV FLASK_APP=flask_app.py FLASK_DEBUG=1 PYTHONUNBUFFERED=1
15+
CMD flask run --host=0.0.0.0 --port=80

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "3"
2+
services:
3+
4+
app:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
depends_on:
9+
- postgres
10+
environment:
11+
- DB_HOST=postgres
12+
- DB_PASSWORD=abc123
13+
volumes:
14+
- ./:/code
15+
ports:
16+
- "5005:80"
17+
18+
19+
postgres:
20+
image: postgres:9.6
21+
environment:
22+
- POSTGRES_USER=allocation
23+
- POSTGRES_PASSWORD=abc123
24+
ports:
25+
- "54321:5432"
26+

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pytest
2+
sqlalchemy
3+
flask
4+
psycopg2

0 commit comments

Comments
 (0)