-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathDockerfile
43 lines (33 loc) · 987 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Use Python 3.13 slim image as base
FROM python:3.13-slim
# Install Redis
RUN apt-get update && \
apt-get install -y redis-server && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt waitress
# Copy application files
COPY . .
# Create directory for Redis data
RUN mkdir -p /data/redis
# Set default environment variables
ENV HOST=0.0.0.0 \
PORT=7000 \
VERIFY_SSL=true \
MAX_QUEUE_SIZE=100 \
FLASK_ENV=production \
FLASK_APP=app.py \
CELERY_BROKER_URL=redis://localhost:6379/0 \
CELERY_RESULT_BACKEND=redis://localhost:6379/0
# Expose ports for Flask and Redis
EXPOSE 7000 6379
# Copy the startup script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Set the entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]