gru/docker/app/Dockerfile

24 lines
793 B
Docker
Raw Normal View History

2023-07-07 01:08:14 +00:00
FROM python:3.11
LABEL maintainer="Amritanshu <docker@tanshu.com>"
ADD https://git.tanshu.com/api/v1/repos/tanshu/gru/tags /tags.json
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/gru.git /app
# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
WORKDIR /app
# Allow installing dev dependencies to run tests
ARG INSTALL_DEV=false
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi"
ENV PYTHONPATH=/app
EXPOSE 80
VOLUME /data
CMD ["poetry", "run", "python", "-m", "gru"]