KTVManager_UI/dockerfile

50 lines
902 B
Plaintext
Raw Permalink Normal View History

2025-07-14 21:15:34 +01:00
# Builder stage
FROM python:3.11-slim-bookworm as builder
2025-07-09 10:59:28 +01:00
RUN apt-get update && apt-get install -y --no-install-recommends \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6 \
libgomp1 \
libgl1 \
2025-07-09 10:59:28 +01:00
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
2025-07-14 21:15:34 +01:00
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
2025-07-14 21:15:34 +01:00
# Final stage
FROM python:3.11-slim-bookworm as final
2025-07-14 22:19:11 +01:00
RUN apt-get update && apt-get install -y --no-install-recommends \
libglib2.0-0 \
libsm6 \
libxrender1 \
libxext6 \
libgomp1 \
libgl1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2025-07-14 21:15:34 +01:00
WORKDIR /app
COPY --from=builder /install /usr/local
COPY . .
2025-07-13 16:00:52 +01:00
RUN chmod +x run.sh
2025-07-09 10:59:28 +01:00
ARG VERSION
RUN echo $VERSION > VERSION
2025-07-14 21:15:34 +01:00
# Create a non-root user
RUN useradd --create-home appuser
USER appuser
2025-07-13 16:00:52 +01:00
EXPOSE 5000
2025-07-13 16:00:52 +01:00
ENV FLASK_ENV production
CMD ["./run.sh"]