Skip to content
Snippets Groups Projects
Dockerfile 652 B
FROM python:3.11-slim as compile-image
RUN apt-get update
RUN apt-get install -y --no-install-recommends git
RUN python -m pip install -U setuptools pip

WORKDIR build_pkg
COPY pyproject.toml .
COPY requirements.txt .
COPY MANIFEST.in .
# need git history for proper version numbering
COPY .git/ .git/
RUN pip install --user -r requirements.txt
COPY metobsapi/ metobsapi/
RUN pip install --user . --no-deps

FROM python:3.11-slim as build-image
COPY --from=compile-image /root/.local /root/.local

COPY docker_run.sh .

# Make sure scripts in .local are usable:
ENV PATH=/root/.local/bin:$PATH
EXPOSE 8090
ENTRYPOINT ["bash", "./docker_run.sh"]
CMD []