mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2025-12-06 15:05:37 +01:00
Init
This commit is contained in:
32
docker/build.dockerfile
Normal file
32
docker/build.dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM python:3.10-slim as build-image
|
||||
|
||||
# RUN apt-get update \
|
||||
# && apt-get install --no-install-recommends -y gcc build-essential python3-dev libpq-dev libffi-dev \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /
|
||||
COPY ./requirements.txt ./
|
||||
|
||||
ENV VENV_PATH=/opt/venv
|
||||
RUN python -m venv $VENV_PATH \
|
||||
&& . "${VENV_PATH}/bin/activate" \
|
||||
&& pip install -r requirements.txt --no-cache-dir
|
||||
|
||||
|
||||
FROM python:3.10-slim as runtime-image
|
||||
|
||||
# RUN apt-get update \
|
||||
# && apt-get install --no-install-recommends -y wget python3-dev libpq-dev libffi-dev default-mysql-client-core \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY ./src/ /app/
|
||||
|
||||
ENV VENV_PATH=/opt/venv
|
||||
COPY --from=build-image $VENV_PATH $VENV_PATH
|
||||
ENV PATH="$VENV_PATH/bin:$PATH"
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
WORKDIR /app/
|
||||
|
||||
CMD uvicorn main:app --host="0.0.0.0" --port="8080"
|
||||
Reference in New Issue
Block a user