Files
lenochka/deploy/dockerfiles/Dockerfile
Pavel Kirilin 2091068ef6 Initial commit.
Signed-off-by: Pavel Kirilin <win10@list.ru>
2021-06-07 02:15:45 +04:00

38 lines
897 B
Docker

FROM python:3.9-alpine3.13
RUN adduser --disabled-password lenochka
RUN apk add --no-cache curl gcc musl-dev
ENV POETRY_VERSION 1.1.6
USER lenochka
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="${PATH}:/home/lenochka/.poetry/bin:/home/lenochka/.local/bin"
RUN source "/home/lenochka/.poetry/env"
# Installing requirements
RUN poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock /home/lenochka/app/
WORKDIR /home/lenochka/app/
RUN poetry install --no-dev
# Copying actuall application
COPY . /home/lenochka/app/src/
WORKDIR /home/lenochka/app/src/
RUN pip install --use-feature=in-tree-build .
WORKDIR /home/lenochka/app
USER root
RUN rm -rf /home/lenochka/app/src
RUN chown -R lenochka /home/lenochka
RUN chmod -R 700 /home/lenochka
RUN apk del curl gcc musl-dev
USER lenochka
CMD "lenochka_wake_up"