mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-01 15:55:49 +03:00
add assets examples
This commit is contained in:
7
examples/assets/README.md
Normal file
7
examples/assets/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Assets (static files) server
|
||||
|
||||
The example demonstrates how to use reproxy.io for static content serving
|
||||
|
||||
- [embed](embed) is a Dockerfile embedding assets into container and serving them with reproxy.
|
||||
Build it with `docker build -t example .` and run with `docker -it --rm -p 80:80 example`. Hit `http://localhost/index.html` (or `http://localhost`) and `http://localhost/1.html`. Alternatively use `docker-compose build && docker-compose up`
|
||||
- [external](external) demonstrates how to serve assets from docker's volume (host's file system). The same as above, but you can also edit files inside `assets` and see the changed responses.
|
||||
5
examples/assets/embed/Dockerfile
Normal file
5
examples/assets/embed/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM umputun/reproxy:master
|
||||
ENV TIME_ZONE=America/Chicago
|
||||
COPY assets /web
|
||||
EXPOSE 80
|
||||
CMD ["/srv/reproxy", "--assets.location=/web", "--listen=0.0.0.0:80"]
|
||||
1
examples/assets/embed/assets/1.html
Normal file
1
examples/assets/embed/assets/1.html
Normal file
@@ -0,0 +1 @@
|
||||
1.html
|
||||
1
examples/assets/embed/assets/index.html
Normal file
1
examples/assets/embed/assets/index.html
Normal file
@@ -0,0 +1 @@
|
||||
index
|
||||
10
examples/assets/embed/docker-compose.yml
Normal file
10
examples/assets/embed/docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
reproxy-embed:
|
||||
build: .
|
||||
container_name: reproxy-embed
|
||||
hostname: reproxy-embed
|
||||
ports:
|
||||
- "80:80"
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- ASSETS_LOCATION=/web
|
||||
4
examples/assets/external/Dockerfile
vendored
Normal file
4
examples/assets/external/Dockerfile
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM umputun/reproxy:master
|
||||
ENV TIME_ZONE=America/Chicago
|
||||
EXPOSE 80
|
||||
CMD ["/srv/reproxy", "--assets.location=/web", "--listen=0.0.0.0:80"]
|
||||
1
examples/assets/external/assets/1.html
vendored
Normal file
1
examples/assets/external/assets/1.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1.html
|
||||
1
examples/assets/external/assets/index.html
vendored
Normal file
1
examples/assets/external/assets/index.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
index
|
||||
12
examples/assets/external/docker-compose.yml
vendored
Normal file
12
examples/assets/external/docker-compose.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
reproxy-external:
|
||||
build: .
|
||||
container_name: reproxy-external
|
||||
hostname: reproxy-external
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./assets:/web
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- ASSETS_LOCATION=/web
|
||||
Reference in New Issue
Block a user