-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.drf-ms-sqlite.wodc
30 lines (21 loc) · 1.07 KB
/
Dockerfile.drf-ms-sqlite.wodc
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
# The doc: https://docs.docker.com/engine/reference/builder/#usage
# Dockerfile-drf-microservice
# Help from: https://www.eidel.io/2017/07/10/dockerizing-django-uwsgi-postgres/
FROM python:3.11.0b1
# The environment variable ensures that the python output is set straight
# to the terminal with out buffering it first
ENV PYTHONUNBUFFERED 1
# create root directory for our project in the container
RUN mkdir /drf-microservice
# Set the working directory to /drf-microservice
WORKDIR /drf-microservice
# Copy the current directory contents into the container at /drf-microservice
ADD . /drf-microservice/
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements/docker-base.txt
RUN export DJANGO_SECRET_KEY=local; export DJANGO_SETTINGS_MODULE=my_api.settings.local; python manage.py makemigrations && python manage.py migrate
EXPOSE 8000
# with uwsgi:
# CMD ["uwsgi", "--ini", "/opt/drf-microservice/uwsgi.ini"]
# or direct:
CMD export DJANGO_SECRET_KEY=local; export DJANGO_SETTINGS_MODULE=my_api.settings.local; python3 manage.py runserver 0.0.0.0:8000