-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (27 loc) · 1.03 KB
/
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
# Use the official Python image
FROM python:3.12.3-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set working directory
WORKDIR /work
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
redis-server \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements files
COPY video_processor/app/requirements.txt /work/video_processor/app/requirements.txt
COPY video_processor/worker/requirements.txt /work/video_processor/worker/requirements.txt
# Install Python dependencies
RUN pip install -r video_processor/app/requirements.txt
RUN pip install -r video_processor/worker/requirements.txt
# Copy project files
COPY . /work/
# Expose FastAPI and Redis ports
EXPOSE 8000
EXPOSE 6379
# Set working directory to video_processor
WORKDIR /work/video_processor
# Command to run the application
CMD ["bash", "-c", "service redis-server start && celery -A worker.celery_worker.app worker --loglevel=info --pool=solo & uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"]