38 lines
791 B
Docker
38 lines
791 B
Docker
FROM python:3.11-slim
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
libpq-dev \
|
|
curl \
|
|
wget \
|
|
netcat-traditional \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create a non-root user
|
|
RUN useradd -m -u 1000 celery
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy the entire application
|
|
COPY . /app/
|
|
|
|
# Set up start.sh
|
|
RUN chmod +x /app/start.sh && \
|
|
chown celery:celery /app/start.sh
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Create necessary directories and set permissions
|
|
RUN mkdir -p /data/rooms && \
|
|
chown -R celery:celery /data && \
|
|
chmod -R 755 /data && \
|
|
chown -R celery:celery /app
|
|
|
|
# Switch to non-root user
|
|
USER celery
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["/app/start.sh"] |