mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-25 17:33:44 +03:00
61 lines
1.4 KiB
Docker
61 lines
1.4 KiB
Docker
ARG PYTHON_VERSION=3.11-slim
|
|
|
|
# define an alias for the specfic python version used in this file.
|
|
FROM python:${PYTHON_VERSION} as python
|
|
|
|
|
|
# Python build stage
|
|
FROM python as python-build-stage
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
# dependencies for building Python packages
|
|
build-essential \
|
|
# psycopg2 dependencies
|
|
libpq-dev \
|
|
# cleaning up unused files
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
# Python 'run' stage
|
|
FROM python as python-run-stage
|
|
|
|
ARG BUILD_ENVIRONMENT
|
|
ENV PYTHONUNBUFFERED 1
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
|
# To run the Makefile
|
|
make \
|
|
# psycopg2 dependencies
|
|
libpq-dev \
|
|
# Translations dependencies
|
|
gettext \
|
|
# Uncomment below lines to enable Sphinx output to latex and pdf
|
|
# texlive-latex-recommended \
|
|
# texlive-fonts-recommended \
|
|
# texlive-latex-extra \
|
|
# latexmk \
|
|
# cleaning up unused files
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
RUN pip install poetry
|
|
|
|
# Configuring poetry
|
|
RUN poetry config virtualenvs.create false
|
|
COPY pyproject.toml poetry.lock /
|
|
|
|
# Installing requirements
|
|
RUN poetry install
|
|
|
|
|
|
COPY ./compose/local/docs/start /start-docs
|
|
RUN sed -i 's/\r$//g' /start-docs
|
|
RUN chmod +x /start-docs
|
|
|
|
WORKDIR /docs
|