Free and open source ticket system written in python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add deployment docu for sqlite3

+79
+79
docs/docker_compose_deployment.md
··· 1 + # Deploying paw with Docker Compose 2 + 3 + ## Prerequisites 4 + 5 + - [Docker installed](https://docs.docker.com/engine/install/) on your machine 6 + - Docker Compose plugin installed on your machine 7 + 8 + ## Deployment with `sqlite` database 9 + 10 + Example `docker-compose.yml` file: 11 + 12 + ```yaml 13 + version: "3.8" 14 + services: 15 + paw: 16 + image: ghcr.io/aottr/paw:latest 17 + container_name: paw-ticket-system 18 + restart: unless-stopped 19 + ports: 20 + - "127.0.0.1:8000:8000" 21 + volumes: 22 + - db:/usr/src/app/db.sqlite3 23 + - media:/usr/src/app/media 24 + environment: 25 + - DATABASE_ENGINE=sqlite3 26 + - DEBUG=true 27 + - ALLOWED_HOSTS=example.org,example.com 28 + - SECRET_KEY=your-secret-key 29 + ``` 30 + 31 + The env variable `DATABASE_ENGINE` must be set to `sqlite3`, otherwise paw expects database credentials and another supported engine, e.g. `postgresql` 32 + 33 + ### Production Deployment 34 + 35 + If, for whatever reason, a production deployment should be used with **sqlite3**, the `media` files need to be served with a webserver / reverse proxy, e.g. nginx. This should also happen with static files. 36 + 37 + For this we slightly modify the deployment volumes: 38 + 39 + ```yaml 40 + --- 41 + volumes: 42 + - db:/usr/src/app/db.sqlite3 43 + - /opt/paw/media:/usr/src/app/media 44 + - /opt/paw/static:/usr/src/app/static 45 + ``` 46 + 47 + Now you write directives in your config to host these files, the following snipped shows an example nginx config: 48 + 49 + ```nginx 50 + upstream paw { 51 + server localhost:8000; 52 + } 53 + 54 + server { 55 + 56 + server_name example.org example.com 57 + listen 80; 58 + listen [::]:80; 59 + 60 + location /media/ { 61 + # media files, uploaded by us 62 + alias /opt/paw/media/; # ending slash is required 63 + } 64 + 65 + location /static/ { 66 + # static files, uploaded by the system 67 + alias /opt/paw/static/; # ending slash is required 68 + } 69 + 70 + location / { 71 + proxy_pass http://paw; 72 + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 73 + proxy_set_header Host $host; 74 + proxy_redirect off; 75 + } 76 + } 77 + ``` 78 + 79 + That's it! You have successfully deployed your project using Docker Compose.