|
@ -1,20 +1,16 @@ |
|
|
FROM python:3.6 |
|
|
|
|
|
|
|
|
FROM alpine:3.9.6 |
|
|
|
|
|
|
|
|
|
|
|
CMD ["python3"] |
|
|
|
|
|
|
|
|
# set work directory |
|
|
|
|
|
WORKDIR /app |
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
# set environment variables |
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1 |
|
|
ENV PYTHONDONTWRITEBYTECODE 1 |
|
|
ENV PYTHONUNBUFFERED 1 |
|
|
ENV PYTHONUNBUFFERED 1 |
|
|
|
|
|
|
|
|
# install psycopg2 dependencies |
|
|
|
|
|
RUN apt-get update \ |
|
|
|
|
|
&& apt-get install --no-install-recommends -y python3-dev libpq-dev unixodbc-dev |
|
|
|
|
|
|
|
|
COPY . /app/ |
|
|
|
|
|
|
|
|
# install dependencies |
|
|
|
|
|
RUN pip install --upgrade pip setuptools |
|
|
|
|
|
COPY ./requirements.txt /app/requirements.txt |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
|
|
|
RUN apk add -U python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \ |
|
|
|
|
|
&& pip3 install --upgrade pip setuptools \ |
|
|
|
|
|
&& pip3 install --no-cache-dir -r requirements.txt \ |
|
|
|
|
|
&& apk del python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev |
|
|
|
|
|
|
|
|
# copy project |
|
|
|
|
|
COPY . /app/ |
|
|
|