Skip to content

Commit

Permalink
Fix mediafiles (#26)
Browse files Browse the repository at this point in the history
* Fix: Fixed mediafiles not being available

* Fix: Fixed brazilian docs validators not being abble to being serialized by migrations

* Lint
  • Loading branch information
inoa-vfabris authored Dec 7, 2023
1 parent f1810ea commit a0a103b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions infra/nginx/vhost.d/default
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
location /static {
alias /usr/share/nginx/static;
}

location /media {
alias /usr/share/nginx/media;
}
2 changes: 1 addition & 1 deletion infra/server/start_nginx_acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ docker run --detach \
--volume html:/usr/share/nginx/html \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
--volume ./infra/nginx/conf.d/custom_proxy.conf:/etc/nginx/conf.d/custom_proxy.conf \
--volume ./infra/nginx/conf.d/fallback_server.conf:/etc/nginx/conf.d/fallback_server.conf \
--volume staticfiles:/usr/share/nginx/static \
--volume mediafiles:/usr/share/nginx/media \
--volume ./infra/nginx/vhost.d/default:/etc/nginx/vhost.d/default \
--network shared \
nginxproxy/nginx-proxy
Expand Down
2 changes: 2 additions & 0 deletions src/app/validators/br/doc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import TYPE_CHECKING

from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import gettext_lazy as _
from validate_docbr import (
CNH,
Expand All @@ -18,6 +19,7 @@
from django_stubs_ext import StrOrPromise


@deconstructible
class BrazilianDocBaseValidator:
message: "StrOrPromise"
validator: BaseDoc
Expand Down
4 changes: 4 additions & 0 deletions staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
dockerfile: infra/app/Dockerfile
volumes:
- staticfiles:/app/storage/static
- mediafiles:/app/storage/media
- translations:/app/locale
ports:
- 80
Expand Down Expand Up @@ -46,6 +47,9 @@ volumes:
external: true
name: staticfiles
translations:
mediafiles:
external: true
name: mediafiles

networks:
shared:
Expand Down

0 comments on commit a0a103b

Please sign in to comment.