Add astro stack for e.field.ghost.tel
This commit is contained in:
1
stacks/astro/.env.template
Normal file
1
stacks/astro/.env.template
Normal file
@@ -0,0 +1 @@
|
|||||||
|
DOMAIN=${DOMAIN}
|
||||||
23
stacks/astro/docker-compose.yml
Normal file
23
stacks/astro/docker-compose.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
services:
|
||||||
|
astro:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: astro
|
||||||
|
restart: unless-stopped
|
||||||
|
expose:
|
||||||
|
- 80
|
||||||
|
volumes:
|
||||||
|
- ./dist:/usr/share/nginx/html:ro
|
||||||
|
- ./nginx-cors.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
networks:
|
||||||
|
- web
|
||||||
|
labels:
|
||||||
|
- "com.ghost.tel/stack-type=public"
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.astro.entrypoints=https"
|
||||||
|
- "traefik.http.routers.astro.rule=Host(`e.field.${DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.astro.tls.certresolver=http"
|
||||||
|
- "traefik.http.services.astro.loadbalancer.server.port=80"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
web:
|
||||||
|
external: true
|
||||||
27
stacks/astro/nginx-cors.conf
Normal file
27
stacks/astro/nginx-cors.conf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
# CORS configuration
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
||||||
|
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
||||||
|
|
||||||
|
# Handle preflight requests
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
|
add_header 'Access-Control-Max-Age' 1728000;
|
||||||
|
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||||
|
add_header 'Content-Length' 0;
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user