Merge branch 'main' into feature/shopping_cart
|
@ -140,3 +140,6 @@ GitHub.sublime-settings
|
|||
*.my_pgpass
|
||||
*.sql
|
||||
artel/static/
|
||||
|
||||
# media
|
||||
artel/media/*
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
repos:
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 21.9b0
|
||||
hooks:
|
||||
- id: black
|
||||
args: [--safe]
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.2.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- id: debug-statements
|
||||
language_version: python3
|
||||
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 3.9.2
|
||||
hooks:
|
||||
- id: flake8
|
||||
language_version: python3
|
|
@ -57,4 +57,4 @@ RUN python manage.py collectstatic --noinput --clear
|
|||
# PRACTICE. The database should be migrated manually or using the release
|
||||
# phase facilities of your hosting platform. This is used only so the
|
||||
# Wagtail instance can be started with a simple "docker run" command.
|
||||
CMD set -xe; python manage.py migrate --noinput; gunicorn artel.wsgi:application
|
||||
CMD set -xe; python manage.py migrate --noinput; gunicorn --bind=0.0.0.0:8000 artel.wsgi:application
|
||||
|
|
|
@ -93,7 +93,7 @@ import dj_database_url as db_url
|
|||
|
||||
DATABASES = {
|
||||
"default": db_url.parse(
|
||||
"postgres://comfy:password@db/comfy_shop"
|
||||
os.environ.get("DATABASE_URL", "postgres://comfy:password@db/comfy_shop")
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,15 @@ from .base import *
|
|||
|
||||
DEBUG = False
|
||||
|
||||
try:
|
||||
from .local import *
|
||||
except ImportError:
|
||||
pass
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||
ALLOWED_HOSTS = [
|
||||
"localhost",
|
||||
"0.0.0.0",
|
||||
"127.0.0.1",
|
||||
"artel.tepewu.pl"
|
||||
]
|
||||
CSRF_TRUSTED_ORIGINS = [
|
||||
"https://0.0.0.0", "http://0.0.0.0",
|
||||
"https://localhost", "http://localhost",
|
||||
"https://artel.tepewu.pl"
|
||||
]
|
||||
|
|
|
@ -1,20 +1,55 @@
|
|||
version: "3.8"
|
||||
services:
|
||||
comfy:
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
context: ./
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_ROOT_PASSWORD: password
|
||||
POSTGRES_USER: comfy
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: comfy_shop
|
||||
- POSTGRES_ROOT_PASSWORD
|
||||
- POSTGRES_USER
|
||||
- POSTGRES_PASSWORD
|
||||
- POSTGRES_DB
|
||||
volumes:
|
||||
- ../postgres/:/var/lib/postgresql
|
||||
env_file:
|
||||
- .env
|
||||
networks:
|
||||
- nginx_network
|
||||
|
||||
comfy:
|
||||
build:
|
||||
dockerfile: Dockerfile
|
||||
context: ./
|
||||
restart: always
|
||||
ports:
|
||||
- "8001:8000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
environment:
|
||||
- SECRET_KEY
|
||||
- DATABASE_URL
|
||||
- DJANGO_SETTINGS_MODULE
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- nginx_network
|
||||
|
||||
web:
|
||||
image: nginx
|
||||
volumes:
|
||||
- ../nginx/conf.d/:/etc/nginx/conf.d/
|
||||
- ./static/:/opt/services/comfy/static
|
||||
- ./media/:/opt/services/comfy/media
|
||||
ports:
|
||||
- "8000:80"
|
||||
environment:
|
||||
- NGINX_HOST=artel.tepewu.pl
|
||||
- NGINX_PORT=80
|
||||
networks:
|
||||
- nginx_network
|
||||
|
||||
networks:
|
||||
nginx_network:
|
||||
driver: bridge
|
||||
|
|
|
@ -8,13 +8,20 @@ services:
|
|||
- "8000:8000"
|
||||
volumes:
|
||||
- ./:/app
|
||||
environment:
|
||||
- SECRET_KEY
|
||||
- DATABASE_URL
|
||||
env_file:
|
||||
- .env
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_ROOT_PASSWORD: password
|
||||
POSTGRES_USER: comfy
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: comfy_shop
|
||||
- POSTGRES_ROOT_PASSWORD
|
||||
- POSTGRES_USER
|
||||
- POSTGRES_PASSWORD
|
||||
- POSTGRES_DB
|
||||
volumes:
|
||||
- ../postgres/:/var/lib/postgresql
|
||||
env_file:
|
||||
- .env
|
||||
|
|
Przed Szerokość: | Wysokość: | Rozmiar: 23 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 58 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 13 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 17 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 5.8 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 386 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 78 KiB |
|
@ -0,0 +1,9 @@
|
|||
[tool.flake8]
|
||||
max-line-length = 120
|
||||
|
||||
[tool.black]
|
||||
line-length = 119
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
multi_line_output = 3
|
|
@ -0,0 +1,4 @@
|
|||
FLAKE8>=6.0.0
|
||||
pre-commit>=3.3.1
|
||||
isort>=5.12
|
||||
black>=23.3.0
|
|
@ -0,0 +1,14 @@
|
|||
[uwsgi]
|
||||
project = artel
|
||||
base = artel/
|
||||
socket_dir = %(base)
|
||||
|
||||
chdir = %(base)
|
||||
module = %(project).wsgi:application
|
||||
|
||||
master = true
|
||||
processes = 5
|
||||
|
||||
socket = %(socket_dir)/%(project).sock
|
||||
vacuum = true
|
||||
daemonize = /var/log/uwsgi/project.log
|