FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PythonSampleLandDjangoTutorial/Dockerfile at Current · DependencyCodeEditorLand/PythonSampleLandDjangoTutorial · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
DependencyCodeEditorLand
/
PythonSampleLandDjangoTutorial
Public
forked from
microsoft/python-sample-vscode-django-tutorial
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Security and quality
Insights
Expand file tree
Breadcrumbs
PythonSampleLandDjangoTutorial
/
Dockerfile
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (31 loc) · 1.65 KB
Breadcrumbs
PythonSampleLandDjangoTutorial
/
Dockerfile
Copy path
File metadata and controls
37 lines (31 loc) · 1.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
#
Pull a pre-built alpine docker image with nginx and python3 installed
FROM
tiangolo/uwsgi-nginx:python3.8-alpine-2020-12-19
#
Set the port on which the app runs; make both values the same.
#
#
IMPORTANT: When deploying to Azure App Service, go to the App Service on the Azure
#
portal, navigate to the Applications Settings blade, and create a setting named
#
WEBSITES_PORT with a value that matches the port here (the Azure default is 80).
#
You can also create a setting through the App Service Extension in VS Code.
ENV
LISTEN_PORT=8000
EXPOSE
8000
#
Indicate where uwsgi.ini lives
ENV
UWSGI_INI uwsgi.ini
#
Tell nginx where static files live. Typically, developers place static files for
#
multiple apps in a shared folder, but for the purposes here we can use the one
#
app's folder. Note that when multiple apps share a folder, you should create subfolders
#
with the same name as the app underneath "static" so there aren't any collisions
#
when all those static files are collected together, as when using Django's
#
collectstatic command.
ENV
STATIC_URL /app/static_collected
#
Copy the app files to a folder and run it from there
WORKDIR
/app
ADD
. /app
#
Make app folder writeable for the sake of db.sqlite3, and make that file also writeable.
#
Ideally you host the database somewhere else so that the app folders can remain read only.
#
Without these permissions you see the errors "unable to open database file" and
#
"attempt to write to a readonly database", respectively, whenever the app attempts to
#
write to the database.
RUN
chmod g+w /app
RUN
chmod g+w /app/db.sqlite3
#
Make sure dependencies are installed
RUN
python3 -m pip install -r requirements.txt
Back
|
FazBrowse Home
|
New Git URL