27 lines
790 B
Docker
27 lines
790 B
Docker
FROM docker.io/python:3.12-slim AS base
|
|
|
|
WORKDIR /app
|
|
|
|
FROM base AS dev
|
|
|
|
RUN pip3 install poetry
|
|
|
|
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
|
|
|
|
CMD [ "poetry", "run", "uvicorn", "--app-dir", "projectorpi_web", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
|
|
|
FROM base AS prod
|
|
|
|
ADD requirements.txt ./
|
|
|
|
RUN apt-get update && apt-get install -y build-essential curl \
|
|
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
|
&& pip3 install --no-cache --upgrade pip \
|
|
&& pip3 install --no-cache -r requirements.txt \
|
|
&& /root/.cargo/bin/rustup self uninstall -y \
|
|
&& apt-get remove -y build-essential curl
|
|
|
|
ADD projectorpi_web ./projectorpi_web
|
|
|
|
CMD ["uvicorn", "--app-dir", "projectorpi_web", "app:app", "--host", "0.0.0.0", "--port", "80" ]
|