Compare commits

...

2 Commits

Author SHA1 Message Date
Aleksandr Tcitlionok
e2076c1b54 fix(docker): simplify Dockerfile 2024-12-05 02:48:45 +00:00
Aleksandr Tcitlionok
24bb773a70 fix(docker): add dockerignore 2024-12-05 02:48:27 +00:00
2 changed files with 12 additions and 18 deletions

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
app/resources.db

View File

@@ -1,32 +1,25 @@
FROM debian:bookworm-slim
FROM python:3.10-slim as base
RUN apt-get update && apt-get install -y \
curl \
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
git \
libncurses5-dev \
libffi-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Install pyenv
RUN curl https://pyenv.run | bash
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PATH"
RUN pyenv install 3.10.12 && pyenv global 3.10.12
RUN python --version
WORKDIR /app
COPY . /app
curl \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY app/requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ /app/
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]