switch to caddy from nginx

remotes/origin/pgsql-count-bits-12
Andrew Dolgov 5 years ago
parent b71a939f76
commit 0d5684ff4c

@ -4,5 +4,6 @@ POSTGRES_PASSWORD=password
OWNER_UID=1000 OWNER_UID=1000
OWNER_GID=1000 OWNER_GID=1000
EXTERNAL_HOST=localhost HTTP_HOST=localhost
EXTERNAL_PORT=8280 HTTP_PORT=8280
HTTPS_PORT=8281

@ -29,7 +29,7 @@ services:
- DB_PASS=${POSTGRES_PASSWORD} - DB_PASS=${POSTGRES_PASSWORD}
- OWNER_UID=${OWNER_UID} - OWNER_UID=${OWNER_UID}
- OWNER_GID=${OWNER_GID} - OWNER_GID=${OWNER_GID}
- SELF_URL_PATH=http://${EXTERNAL_HOST}:${EXTERNAL_PORT}/tt-rss - SELF_URL_PATH=http://${HTTP_HOST}:${HTTP_PORT}/tt-rss
volumes: volumes:
- app:/var/www/html - app:/var/www/html
depends_on: depends_on:
@ -39,12 +39,28 @@ services:
build: ./web build: ./web
restart: unless-stopped restart: unless-stopped
ports: ports:
- ${EXTERNAL_PORT}:80 - ${HTTP_PORT}:2015
volumes: volumes:
- app:/var/www/html:ro - app:/var/www/html:ro
depends_on: depends_on:
- app - app
# web-ssl:
# build: ./web-ssl
# restart: unless-stopped
# environment:
# - CADDYPATH=/certs
# - HTTP_HOST=${HTTP_HOST}
# ports:
# - ${HTTP_PORT}:80
# - ${HTTPS_PORT}:443
# volumes:
# - app:/var/www/html:ro
# - certs:/certs
# depends_on:
# - app
volumes: volumes:
db: db:
app: app:
certs:

@ -0,0 +1,8 @@
{%HTTP_HOST%}
tls ttrss@{%HTTP_HOST%}
root /var/www/html
log stdout
errors stderr
internal /tt-rss/cache
fastcgi / app:9000 php

@ -0,0 +1,3 @@
FROM abiosoft/caddy:no-stats
COPY Caddyfile /etc/

@ -0,0 +1,6 @@
0.0.0.0
root /var/www/html
log stdout
errors stderr
internal /tt-rss/cache
fastcgi / app:9000 php

@ -1,3 +1,3 @@
FROM nginx:alpine FROM abiosoft/caddy:no-stats
COPY nginx.conf /etc/nginx/nginx.conf COPY Caddyfile /etc/

@ -1,55 +0,0 @@
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
error_log /dev/stderr warn;
sendfile on;
index index.php;
upstream app {
server app:9000;
}
server {
listen 80;
root /var/www/html;
location /tt-rss/cache {
aio threads;
internal;
}
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass app;
}
location / {
try_files $uri $uri/ =404;
}
}
}
Loading…
Cancel
Save