welcomecenterbot/Dockerfile

23 lines
548 B
Docker
Raw Normal View History

2024-09-26 20:58:11 +00:00
# Stage 1: Build stage
2024-09-26 21:42:33 +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 21:42:03 +00:00
RUN apt-get update && apt-get install -y --no-install-recommends gcc libffi-dev libssl-dev
2024-09-27 05:39:09 +00:00
RUN pip install asyncio redis
2024-09-26 21:42:03 +00:00
RUN pip install --no-cache-dir -r requirements.txt && rm -rf /var/lib/apt/lists/*
2024-09-26 20:58:11 +00:00
# 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"]