-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (26 loc) · 964 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
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Set the working directory in the container
WORKDIR /app
# Install dependencies
RUN apt-get update && apt-get install -y \
python3-venv \
linux-headers-amd64 \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Create a virtual environment
RUN python3 -m venv /opt/venv
# Activate the virtual environment
ENV PATH="/opt/venv/bin:$PATH"
# Copy the requirements file into the container
COPY requirements.txt .
# Install the dependencies
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . .
# Expose port 8000 for the Django application
EXPOSE 8000
# Run the Django application
CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000", "celery", "-A", "roammatesapp.celery", "worker", "-l", "info"]