forked from ciarareeve/webSTR-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (21 loc) · 831 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.8-slim-buster as base
LABEL maintainer="merenlin -- follow me on medium https://medium.com/@merenlin"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN mkdir -p /usr/src/strs
WORKDIR /usr/src/strs
COPY requirements.txt .
RUN apt-get update && \
apt-get install -y gcc python3-dev build-essential && \
python -m pip install -r requirements.txt --no-cache-dir && \
apt-get remove -y gcc python3-dev build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ENV DATABASE_URL=sqlite:///db/debug.db
FROM base as prod
LABEL maintainer="merenlin -- follow me on medium https://medium.com/@merenlin"
RUN adduser -u 1000 --disabled-password --gecos "" appuser && chown -R appuser /usr/src/strs
USER appuser
COPY . .
ARG PORT=5000
EXPOSE $PORT
ENTRYPOINT [ "bash", "entrypoint.sh"]