♻️ Put api_server and db_updater scripts on the backend root
This commit is contained in:
36
backend/Dockerfile.api_server
Normal file
36
backend/Dockerfile.api_server
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM python:3.11-slim as builder
|
||||
|
||||
RUN pip install poetry
|
||||
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml /app
|
||||
|
||||
RUN poetry install --only=main --no-root && \
|
||||
rm -rf ${POETRY_CACHE_DIR}
|
||||
|
||||
|
||||
FROM python:3.11-slim as runtime
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y --no-install-recommends libpq5 && \
|
||||
apt clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
env VIRTUAL_ENV=/app/.venv \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
||||
|
||||
COPY api /app/api
|
||||
COPY config.sample.yaml .
|
||||
COPY api_server.py .
|
||||
|
||||
CMD ["./api_server.py"]
|
Reference in New Issue
Block a user