-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
cb464f9
commit 1fe9278
Showing
7 changed files
with
58 additions
and
29 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
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
// TODO: complete the launch.json | ||
"version": "0.2.0", | ||
"configurations": [] | ||
} | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug: svc", | ||
"type": "python", | ||
"request": "attach", | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}", | ||
"remoteRoot": "/workspace" | ||
} | ||
], | ||
"port": 5678, | ||
"host": "localhost" | ||
} | ||
] | ||
} |
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,6 @@ | ||
{ | ||
"python.testing.pytestArgs": ["backend"], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.pytestPath": "/usr/local/bin/pytest" | ||
} |
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 |
---|---|---|
@@ -1,28 +1,30 @@ | ||
# base image of the docker container | ||
# For more information, please refer to https://aka.ms/vscode-docker-python | ||
FROM python:3.9.1 | ||
|
||
# set the user to non root | ||
# RUN useradd -ms /bin/bash appuser -u 1000 | ||
EXPOSE 8000 | ||
|
||
# USER appuser | ||
|
||
# setting enviromenat variable | ||
# Keeps Python from generating .pyc files in the container | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Turns off buffering for easier container logging | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# defining the work directory in the docker container | ||
WORKDIR /workspace | ||
# Install pip requirements | ||
COPY requirements*.txt . | ||
RUN python -m pip install -r requirements-dev.txt | ||
|
||
# copying the requirements.txt file to the work directory | ||
COPY requirements*.txt ./ | ||
|
||
# Installing the python requirement on the container | ||
RUN pip install -r requirements-dev.txt | ||
|
||
RUN pip install debugpy -t /tmp | ||
WORKDIR /workspace | ||
COPY . /workspace | ||
|
||
# copying all local file to the container | ||
COPY . ./ | ||
# 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 /workspace | ||
USER appuser | ||
|
||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "core.wsgi"] |
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-r requirements.txt | ||
coverage==6.5.0 | ||
pytest==6.2.4 | ||
pytest-django | ||
pytest-django==4.5.2 | ||
gunicorn |