gru/docker/app/Dockerfile

24 lines
747 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
2023-07-07 01:33:07 +00:00
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \
2023-07-07 01:08:14 +00:00
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"]