создаём фаил docker-compose.yml и пишем в него содержимое
version: '3.2'
services:
postgres:
image: postgres
restart: always
container_name: postgres
environment:
POSTGRES_DB: passit
POSTGRES_USER: passit
POSTGRES_PASSWORD: **you-password**
PGDATA: /var/lib/postgresql/data/
volumes:
- /var/lib/postgresql/data:/var/lib/postgresql/data
passit-app:
image: passit/passit:stable
restart: always
container_name: passit-app
command: bin/start.sh
environment:
DATABASE_URL: postgres://**passit:you-password**@postgres:5432/passit
SECRET_KEY: **you-password**
IS_DEBUG: 'False'
EMAIL_URL: smtp+tls://**login:password@name-server-email**:587
DEFAULT_FROM_EMAIL: "**you-email**"
EMAIL_CONFIRMATION_HOST: "**you domaine passit app**"
nginx:
container_name: nginx
restart: always
image: nginx
ports:
- 80:80
- 443:443
volumes:
- /etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
- /etc/letsencrypt/live/**you domaine passit app**/fullchain.pem:/etc/letsencrypt/live/**you domaine passit app**/fullchain.pem
- /etc/letsencrypt/live/**you domaine passit app**/privkey.pem:/etc/letsencrypt/live/**you domaine passit app**/privkey.pem
конфигурацию веб сервера default.conf записываем в любую папку папку, для примера используется /etc/nginx/conf.d/
server {
listen 80;
server_name **you domaine passit app**;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name **you domaine passit app**;
ssl_certificate /etc/letsencrypt/live/**you domaine passit app**/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/**you domaine passit app**/privkey.pem;
location / {
proxy_pass http://passit-app:8080;
proxy_set_header Host $host;
}
}
после запуска контейнеров необходимо мигрировать БД
docker-compose run --rm passit-app ./manage.py migrate