Update for new deployment with Caddy and docker networks
This commit is contained in:
@ -2,11 +2,11 @@ HOST=0.0.0.0
|
||||
PORT=80
|
||||
LOG_LEVEL=WARN
|
||||
DEBUG=false
|
||||
SQLALCHEMY_DATABASE_URI=postgresql+psycopg://postgres:123456@db:5432/petty{{ name }}
|
||||
SQLALCHEMY_DATABASE_URI=postgresql+psycopg://postgres:123456@postgres:5432/petty{{ name }}
|
||||
MODULE_NAME=barker.main
|
||||
PROJECT_NAME=barker
|
||||
MAX_WORKERS=4
|
||||
REDIS_HOST=redis
|
||||
REDIS_HOST=valkey
|
||||
REDIS_PORT=6379
|
||||
SECRET_KEY={{ secret_key }}
|
||||
MIDDLEWARE_SECRET_KEY={{ middleware_key }}
|
||||
|
||||
24
ansible/files/Caddyfile.j2
Normal file
24
ansible/files/Caddyfile.j2
Normal file
@ -0,0 +1,24 @@
|
||||
{{ host }} {
|
||||
# Match and proxy API routes
|
||||
@apiRoutes {
|
||||
path_regexp ^/(api|token|refresh|db-image)
|
||||
}
|
||||
handle @apiRoutes {
|
||||
reverse_proxy @apiRoutes {{ host_directory }}:80
|
||||
}
|
||||
|
||||
# Match requests that end with .js, .css, .ico, or .html
|
||||
@staticFiles {
|
||||
path_regexp \.(js|css|ico|html)$
|
||||
}
|
||||
handle @staticFiles {
|
||||
rewrite * /static{uri}
|
||||
reverse_proxy {{ host_directory }}:80
|
||||
}
|
||||
|
||||
# All other frontend routes → /static/index.html
|
||||
handle {
|
||||
rewrite * /static/index.html
|
||||
reverse_proxy {{ host_directory }}:80
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user