mirror of
https://github.com/omaha-consulting/winget.pro.git
synced 2026-10-24 12:52:26 +00:00
First implementation of Docker support
This commit is contained in:
Symlink
+1
@@ -0,0 +1 @@
|
||||
/home/michael/dev/api.winget.pro/.gitignore
|
||||
@@ -73,6 +73,9 @@ Upload [`install.sh`](install.sh) and a `.bashrc` file with the settings below
|
||||
to a Debian 11 server, then run `install.sh` as root.
|
||||
|
||||
```bash
|
||||
# Set DEBUG to False in production:
|
||||
export DEBUG=False
|
||||
|
||||
# The domain under which this server runs:
|
||||
export HOST_NAME=some.domain.com
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*
|
||||
@@ -0,0 +1,19 @@
|
||||
FROM python:3.9
|
||||
|
||||
ENV DEBUG=False
|
||||
ENV HOST_NAME=*
|
||||
|
||||
WORKDIR /srv
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pip install --no-cache-dir -Ur requirements/base-full.txt
|
||||
|
||||
RUN python manage.py migrate
|
||||
|
||||
RUN python manage.py collectstatic --noinput
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["gunicorn", "core.wsgi:application", "--bind", "0.0.0.0:8000", \
|
||||
"--log-level=warning", "--log-file=-"]
|
||||
@@ -0,0 +1,24 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
django:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: deploy/Dockerfile
|
||||
volumes:
|
||||
- static:/srv/static
|
||||
- media:/srv/media
|
||||
nginx:
|
||||
image: nginx:1.25.3
|
||||
volumes:
|
||||
- static:/srv/static
|
||||
- media:/srv/media
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
ports:
|
||||
- "8000:80"
|
||||
depends_on:
|
||||
- django
|
||||
|
||||
volumes:
|
||||
static:
|
||||
media:
|
||||
@@ -0,0 +1,32 @@
|
||||
# The events block is required; We need to supply it, even if empty:
|
||||
events {}
|
||||
|
||||
http {
|
||||
# Make Nginx serve CSS files as text/css instead of text/plain. Otherwise,
|
||||
# the browser does not apply styles:
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
upstream django {
|
||||
server django:8000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location /static/ {
|
||||
alias /srv/static/;
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
alias /srv/media/;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://django;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user