aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 7c527f5406025c1edfa8b177dd3f12be200ff087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.8-slim AS builder

LABEL maintainer = "Navan Chauhan <navanchauhan@gmail.com>" \
	org.label-schema.name="SaaS-in-a-Flask" \
	org.label-schema.description="https://web.navan.dev/SaaS-in-a-Flask"

EXPOSE 5000

WORKDIR /saas-in-a-flask

COPY simple-requirements.txt api.py ./
RUN apt-get update \
    && apt-get install -y --no-install-recommends gcc libssl-dev libffi-dev python3-dev build-essential \
    && rm -rf /var/lib/apt/lists/* \
    && pip install --upgrade pip \
    && pip install -r simple-requirements.txt \
    && apt-get purge -y --auto-remove gcc libssl-dev libffi-dev python3-dev build-essential

COPY ./app ./app

RUN FLASK_APP=app flask database create
RUN FLASK_APP=app flask database admin-create 

CMD gunicorn -w 4 api:app -k uvicorn.workers.UvicornWorker -b "0.0.0.0:5000"