-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Raghav Sharma <[email protected]>
- Loading branch information
1 parent
cdf07cb
commit 986422c
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# For more information, please refer to https://aka.ms/vscode-docker-python | ||
FROM python:3.8-slim-buster | ||
|
||
# Keeps Python from generating .pyc files in the container | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Turns off buffering for easier container logging | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install pip requirements | ||
COPY requirements.txt . | ||
RUN pip install gunicorn[gevent] | ||
RUN python -m pip install -r requirements.txt | ||
|
||
WORKDIR /app | ||
COPY . /app | ||
RUN mkdir officialWebsite/database | ||
|
||
# Creates a non-root user with an explicit UID and adds permission to access the /app folder | ||
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers | ||
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app | ||
USER root | ||
|
||
|
||
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug | ||
CMD ["sh", "run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.4' | ||
|
||
services: | ||
officialwebsiteapi: | ||
image: officialwebsiteapi | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- ./database/:/app/officialWebsite/database/ | ||
restart: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python manage.py migrate | ||
python manage.py collectstatic | ||
gunicorn --worker-class gevent --certfile=cert.pem --keyfile=privkey.pem --bind 0.0.0.0:8000 officialWebsite.config.wsgi:application |