welcomecenterbot/Dockerfile

27 lines
564 B
Docker
Raw Normal View History

2024-09-26 20:58:11 +00:00
# Stage 1: Build stage
2024-09-26 21:19:58 +00:00
FROM python:slim AS builder
2024-01-06 11:25:35 +00:00
2023-09-11 20:04:53 +00:00
WORKDIR /app
2024-01-06 11:25:35 +00:00
2024-02-12 12:50:35 +00:00
COPY requirements.txt .
2024-01-06 11:25:35 +00:00
2024-09-26 20:58:11 +00:00
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libffi-dev \
2024-09-26 21:09:51 +00:00
libssl-dev
2024-09-26 21:12:15 +00:00
RUN pip install triton
2024-09-26 21:09:51 +00:00
RUN pip install --no-cache-dir -r requirements.txt \
2024-09-26 20:58:11 +00:00
&& rm -rf /var/lib/apt/lists/*
# Stage 2: Final stage
FROM python:slim
WORKDIR /app
2024-02-12 12:50:35 +00:00
2024-09-26 20:58:11 +00:00
# Copy only necessary files from the builder stage
COPY --from=builder /usr/local/lib/python3.*/dist-packages /usr/local/lib/python3.*/dist-packages
2024-02-12 12:50:35 +00:00
COPY . .
EXPOSE 8080
2024-09-26 20:58:11 +00:00
CMD ["python", "main.py"]