Move Caddyfile into config/
This commit is contained in:
parent
d6e8a6013a
commit
2c513b34c8
@ -17,12 +17,11 @@ RUN addgroup -S app && adduser app -S -G app
|
||||
WORKDIR /home/app
|
||||
RUN mkdir /home/app/tmp && chown app /home/app/tmp
|
||||
|
||||
|
||||
RUN mkdir runtimes public
|
||||
COPY public/ public/
|
||||
COPY Caddyfile ./
|
||||
COPY --from=build /home/app/bin/faaso-daemon /home/app/bin/faaso /usr/bin/
|
||||
|
||||
# Mount points for persistent data
|
||||
RUN mkdir /secrets
|
||||
RUN mkdir /config
|
||||
|
||||
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "caddy run --config Caddyfile"]
|
||||
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "caddy run --config config/Caddyfile"]
|
||||
|
9
Makefile
9
Makefile
@ -5,7 +5,14 @@ build: shard.yml $(wildcard src/**/*) $(runtimes/**/*)
|
||||
proxy: build
|
||||
docker build . -t faaso-proxy
|
||||
start-proxy:
|
||||
docker run --name faaso-proxy-one --rm --network=faaso-net --env-file=proxy.env -e FAASO_SECRET_PATH=${PWD}/secrets -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/secrets:/home/app/secrets -p 8888:8888 faaso-proxy
|
||||
docker run --name faaso-proxy-one \
|
||||
--rm --network=faaso-net \
|
||||
--env-file=proxy.env \
|
||||
-e FAASO_SECRET_PATH=${PWD}/secrets \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ${PWD}/secrets:/home/app/secrets \
|
||||
-v ${PWD}/config:/home/app/config \
|
||||
-p 8888:8888 faaso-proxy
|
||||
|
||||
|
||||
.PHONY: build proxy-image start-proxy
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
http://*:8888 {
|
||||
basicauth /admin/* {
|
||||
admin {$FAASO_PASSWORD}
|
||||
admin {$HTTP_BASIC_AUTH_PASSWORD}
|
||||
}
|
||||
|
||||
handle_path /admin/terminal/* {
|
||||
@ -15,4 +15,13 @@ http://*:8888 {
|
||||
handle_path /admin/* {
|
||||
reverse_proxy /* http://127.0.0.1:3000
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
handle_path /faaso/myfunko/* {
|
||||
reverse_proxy /* http://faaso-myfunko-kyfo2v:3000 {
|
||||
health_uri /ping
|
||||
fail_duration 30s
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -2,8 +2,10 @@ require "docr"
|
||||
require "./funko.cr"
|
||||
require "kemal"
|
||||
|
||||
|
||||
module Proxy
|
||||
@@current_config = File.read("Caddyfile")
|
||||
CADDY_CONFIG_PATH = "config/Caddyfile"
|
||||
@@current_config = File.read(CADDY_CONFIG_PATH)
|
||||
|
||||
# Get current proxy config
|
||||
get "/proxy/" do
|
||||
@ -64,7 +66,7 @@ CONFIG
|
||||
|
||||
if @@current_config != config
|
||||
Log.info { "Updating proxy config" }
|
||||
File.open("Caddyfile", "w") do |file|
|
||||
File.open(CADDY_CONFIG_PATH, "w") do |file|
|
||||
file << config
|
||||
end
|
||||
# Reload config
|
||||
|
@ -1,12 +0,0 @@
|
||||
|
||||
User nobody
|
||||
Group nogroup
|
||||
Port 8888
|
||||
Listen 0.0.0.0
|
||||
Timeout 600
|
||||
Allow 0.0.0.0/0
|
||||
ReverseOnly Yes
|
||||
ReverseMagic Yes
|
||||
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
||||
ReversePath "/admin/terminal" "http://127.0.0.1:7681"
|
||||
ReversePath "/faaso/hello/" "http://hello-d89veq:3000/"
|
Loading…
Reference in New Issue
Block a user