-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (24 loc) · 834 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
# Brief: Dockerfile for the API
# Description: This file is used to create a Docker image for the API
# Author: Divij Sharma <[email protected]>
# base image
FROM python:3.11
# setup environment variable for work directory
ENV API_HOME=/home/app/webapp
# make work directory
RUN mkdir -p $API_HOME
# set work directory
WORKDIR $API_HOME
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# copy api directory to docker's work directory.
COPY . $API_HOME
# install dependencies
RUN pip install --upgrade pip && pip install -r requirements.txt
# make migrations and migrate all migrations
RUN python manage.py makemigrations && python manage.py migrate
# port where the Django app runs
EXPOSE 8080
# start server
ENTRYPOINT ["python", "manage.py", "runserver", "0.0.0.0:8080"]