no more apache2
|
|
@ -1,26 +0,0 @@
|
|||
WSGIScriptAlias / /var/www/sciodog.fr/sciodog/wsgi.py
|
||||
WSGIPythonHome /var/www/sciodog.fr/venv
|
||||
WSGIPythonPath /var/www/sciodog.fr
|
||||
|
||||
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
|
||||
Alias /static /var/www/sciodog.fr/blog/static/
|
||||
|
||||
<Directory /var/www/sciodog.fr/blog/static>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName sciodog.fr
|
||||
|
||||
<Directory /var/www/sciodog.fr/sciodog>
|
||||
<Files wsgi.py>
|
||||
Require all granted
|
||||
</Files>
|
||||
</Directory>
|
||||
LogLevel info
|
||||
ErrorLog /var/log/apache2/django-error.log
|
||||
CustomLog /var/log/apache2/django-access.log combined
|
||||
RewriteEngine on
|
||||
RewriteCond %{SERVER_NAME} =sciodog.fr
|
||||
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
||||
</VirtualHost>
|
||||
14
docker-compose.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
services:
|
||||
sciodog:
|
||||
build:
|
||||
context: sciodog-app
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
WSGI_FILE: "sciodog.wsgi"
|
||||
HOSTNAME: "sciodog.fr"
|
||||
PORT: 80
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: "wget -O/dev/null -q http://127.0.0.1/"
|
||||
interval: 0.5s
|
||||
retries: 30
|
||||
21
sciodog-app/Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# WSGI_FILE : file used as the app to run, passed to uwsgi --module option
|
||||
# PORT : Port on which the app is exposed
|
||||
# APP_DIR : Path of the app on the host machine. It will be mounted on /var/www/html in the container
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
# UWSGI Configuration
|
||||
COPY configuration/ /etc/uwsgi/
|
||||
RUN mkdir -p /etc/uwsgi ; \
|
||||
adduser uwsgi -S -D -H -s /usr/sbin/nologin ; \
|
||||
apk add python3 python3-dev py3-pip gcc musl-dev linux-headers ; \
|
||||
pip install --break-system-packages uwsgi django
|
||||
|
||||
# Application configuration
|
||||
WORKDIR /var/www/html
|
||||
COPY ./app/ .
|
||||
RUN pip install --break-system-packages -r requirements.txt
|
||||
|
||||
EXPOSE ${PORT}
|
||||
|
||||
ENTRYPOINT ["uwsgi", "--ini", "/etc/uwsgi/uwsgi.ini"]
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 967 KiB After Width: | Height: | Size: 967 KiB |
|
Before Width: | Height: | Size: 13 MiB After Width: | Height: | Size: 13 MiB |
|
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 6 KiB After Width: | Height: | Size: 6 KiB |
|
Before Width: | Height: | Size: 841 KiB After Width: | Height: | Size: 841 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 852 KiB After Width: | Height: | Size: 852 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 314 KiB After Width: | Height: | Size: 314 KiB |
|
Before Width: | Height: | Size: 379 KiB After Width: | Height: | Size: 379 KiB |
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.3 MiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
|
@ -1,3 +1,4 @@
|
|||
django==4.2.7
|
||||
python-dotenv==1.0.0
|
||||
requests
|
||||
tzdata
|
||||
|
|
@ -29,7 +29,7 @@ SECRET_KEY = 'django-insecure-^cysot^fcha7(@k!3u5zf1-!in_&k^1-j1i@0yqi+k+vpda@s5
|
|||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True #os.environ["DEBUG"] != None
|
||||
|
||||
ALLOWED_HOSTS = [os.environ["HOST"], "sciodog.fr"]
|
||||
ALLOWED_HOSTS = [os.environ["HOSTNAME"], "sciodog.fr"]
|
||||
|
||||
|
||||
# Application definition
|
||||
5
sciodog-app/configuration/test.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# test.py
|
||||
def application(env, start_response):
|
||||
start_response('200 OK', [('Content-Type','text/html')])
|
||||
return [b"Hello World"] # python3
|
||||
|
||||
10
sciodog-app/configuration/uwsgi.ini
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[uwsgi]
|
||||
chdir = /var/www/html
|
||||
master = true
|
||||
uid = uwsgi
|
||||
logto = /var/log/uwsgi.log
|
||||
http-socket = 0.0.0.0:$(PORT)
|
||||
module = $(WSGI_FILE)
|
||||
processes = 4
|
||||
threads = 2
|
||||
die-on-term = true
|
||||