Update Dockerfile
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -15,22 +15,25 @@ RUN useradd -m -u 1000 celery
|
|||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy requirements first to leverage Docker cache
|
# Copy start.sh first and set permissions
|
||||||
|
COPY start.sh .
|
||||||
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
|
# Copy requirements and install dependencies
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Copy application code
|
# Copy the rest of the application
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Create necessary directories and set permissions
|
# Create necessary directories and set permissions
|
||||||
RUN mkdir -p /data/rooms && \
|
RUN mkdir -p /data/rooms && \
|
||||||
chown -R celery:celery /data && \
|
chown -R celery:celery /data && \
|
||||||
chmod -R 755 /data && \
|
chmod -R 755 /data && \
|
||||||
chown -R celery:celery /app && \
|
chown -R celery:celery /app
|
||||||
chmod +x /app/start.sh
|
|
||||||
|
|
||||||
# Switch to non-root user
|
# Switch to non-root user
|
||||||
USER celery
|
USER celery
|
||||||
|
|
||||||
# Set entrypoint
|
# Set entrypoint
|
||||||
ENTRYPOINT ["/app/start.sh"]
|
ENTRYPOINT ["./start.sh"]
|
||||||
Reference in New Issue
Block a user