mirror of
https://ak-git.vectorsigma.ru/terghalin/metalcheck.git
synced 2025-10-26 07:15:53 +09:00
fix(docker): simplify Dockerfile
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user