diff --git a/examples/static/README.md b/examples/static/README.md new file mode 100644 index 0000000..c943a2f --- /dev/null +++ b/examples/static/README.md @@ -0,0 +1,5 @@ +# Example of a static provider within docker compose + + +The example under `custom` shows how to make a web-serving container built on top of reproxy image and routing api request to another container directly, without the actual docker discovery. + diff --git a/examples/static/custom/Dockerfile b/examples/static/custom/Dockerfile new file mode 100644 index 0000000..13869aa --- /dev/null +++ b/examples/static/custom/Dockerfile @@ -0,0 +1,12 @@ +# example of a Dockerfile using reproxy as a base for the custom container +FROM klakegg/hugo:0.83.1-ext-alpine as build + +ADD . /build +WORKDIR /build +RUN hugo --minify + +FROM ghcr.io/umputun/reproxy:latest +COPY --from=build /build/public /www +EXPOSE 8080 +USER app +ENTRYPOINT ["/srv/reproxy"] diff --git a/examples/static/custom/docker-compose.yml b/examples/static/custom/docker-compose.yml new file mode 100644 index 0000000..4c8fc86 --- /dev/null +++ b/examples/static/custom/docker-compose.yml @@ -0,0 +1,51 @@ +version: '2.4' + +services: + + website: + image: somtehing/hugo-site + restart: always + container_name: website + hostname: website + logging: &default_logging + driver: json-file + options: + max-size: "10m" + max-file: "5" + ports: + - "80:8080" + - "443:8443" + volumes: + - ./var/ssl:/srv/var/ssl + - ./var/logs:/srv/var/logs + environment: + - TZ=America/Chicago + - GZIP=true + - MAX_SIZE=256K + - LOGGER_ENABLED=true + - LOGGER_FILE=/srv/var/logs/access.log + - SSL_TYPE=auto + - SSL_ACME_EMAIL=me@example.com + - SSL_ACME_FQDN=site.example.com + - SSL_ACME_LOCATION=/srv/var/ssl + - HEADER= + X-Frame-Options:SAMEORIGIN, + X-XSS-Protection:1; mode=block;, + X-Content-Type-Options:nosniff, + Strict-Transport-Security:max-age=31536000, + Referrer-Policy:no-referrer, + Content-Security-Policy:default-src 'self'; style-src 'self' 'unsafe-inline'; + - ASSETS_LOCATION=/www + - ASSETS_CACHE=48h,text/html:1m + - STATIC_ENABLED=true + - STATIC_RULES=*,/api/email/(.*),http://email-sender:8080/$$1,http://email-sender:8080/ping + + email-sender: + image: somtehing/email-sender + restart: always + container_name: email-sender + hostname: email-sender + logging: *default_logging + ports: + - "8080" +