-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 727 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 727 Bytes
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
# Use an official Python runtime as a parent image
FROM python:3.8-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN python -m venv venv && \
. venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt
# Run migrations
RUN . venv/bin/activate && \
python manage.py migrate
# Expose the port the app runs on
EXPOSE 8888
# Command to run your application
CMD ["sh", "-c", ". venv/bin/activate && python manage.py runserver 0.0.0.0:8888"]