update cdn
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
- `mc alias set ...`
|
||||||
|
- `mc cp ~/pictures/memes_a_dalsi/sap500.png ranpu-test/44gyu-test1/xxx`
|
||||||
|
- create `nginx` service
|
||||||
|
- update secret envs for env replace
|
||||||
|
```
|
||||||
|
# prg1
|
||||||
|
DOMAIN=nginx.zerops.matejpavlicek.cz
|
||||||
|
STORAGE_HOST=storage-prg1.zerops.io
|
||||||
|
STORAGE_BUCKET=4gh42-bucket1
|
||||||
|
STORAGE_OBJECT=gopher_profilovka.png
|
||||||
|
|
||||||
|
# ranpu
|
||||||
|
DOMAIN=g99f14mbh7c3n9u5gdsi4d5kp90.ranpu.dev-zerops.cloud
|
||||||
|
STORAGE_HOST=storage-ranpu.zerops.io
|
||||||
|
STORAGE_BUCKET=44gyu-test1
|
||||||
|
STORAGE_OBJECT=xxx
|
||||||
|
```
|
||||||
|
- push to `nginx` service
|
||||||
|
- enable domain for it
|
||||||
+19
-15
@@ -3,30 +3,34 @@
|
|||||||
<title>CDN TEST</title>
|
<title>CDN TEST</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>TEST</h1>
|
<h1>STATIC</h1>
|
||||||
<p>
|
<p>
|
||||||
direct static
|
direct:
|
||||||
<img height="128" src="static/gopher_profilovka.png" alt="gopher"/>
|
<img height="128" src="static/gopher_profilovka.png" alt="gopher"/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
cdn static
|
cdn:
|
||||||
<img height="128" src="https://static.cdn.zerops.app/nginx.zerops.matejpavlicek.cz/static/gopher_profilovka.png" alt="gopher"/>
|
<img height="128" src="https://static.cdn.zerops.app/%%DOMAIN%%/static/gopher_profilovka.png" alt="gopher"/>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
direct s3
|
fetch cdn:
|
||||||
<img height="128" src="https://storage-prg1.zerops.io/4gh42-bucket1/gopher_profilovka.png" alt="gopher"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
cdn s3
|
|
||||||
<img height="128" src="https://storage.cdn.zerops.app/4gh42-bucket1/gopher_profilovka.png" alt="gopher"/>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
fetch static
|
|
||||||
<div id="image-container"></div>
|
<div id="image-container"></div>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<h1>STORAGE</h1>
|
||||||
|
<p>
|
||||||
|
direct:
|
||||||
|
<img height="128" src="https://%%STORAGE_HOST%%/%%STORAGE_BUCKET%%/%%STORAGE_OBJECT%%" alt="s3-image"/>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
cdn:
|
||||||
|
<img height="128" src="https://storage.cdn.zerops.app/%%STORAGE_BUCKET%%/%%STORAGE_OBJECT%%" alt="s3-image"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
fetch('https://static.cdn.zerops.app/nginx.zerops.matejpavlicek.cz/static/gopher_profilovka.png')
|
fetch('https://static.cdn.zerops.app/%%DOMAIN%%/static/gopher_profilovka.png')
|
||||||
.then(response => response.blob())
|
.then(response => response.blob())
|
||||||
.then(blob => {
|
.then(blob => {
|
||||||
const objectURL = URL.createObjectURL(blob);
|
const objectURL = URL.createObjectURL(blob);
|
||||||
@@ -45,4 +49,4 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 271 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 264 KiB |
@@ -0,0 +1,15 @@
|
|||||||
|
services:
|
||||||
|
- hostname: nginx
|
||||||
|
type: nginx@latest
|
||||||
|
envSecrets:
|
||||||
|
STORAGE_HOST: storage-prg1.zerops.io
|
||||||
|
STORAGE_BUCKET: 4gh42-bucket1
|
||||||
|
STORAGE_OBJECT: gopher_profilovka.png
|
||||||
|
DOMAIN: nginx.zerops.matejpavlicek.cz
|
||||||
|
maxContainers: 1
|
||||||
|
# - hostname: app
|
||||||
|
# type: alpine@3.20
|
||||||
|
# maxContainers: 1
|
||||||
|
# - hostname: static
|
||||||
|
# type: static@latest
|
||||||
|
# maxContainers: 1
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
services:
|
|
||||||
- hostname: app
|
|
||||||
type: alpine@3.20
|
|
||||||
maxContainers: 1
|
|
||||||
- hostname: static
|
|
||||||
type: static@latest
|
|
||||||
maxContainers: 1
|
|
||||||
- hostname: nginx
|
|
||||||
type: nginx@latest
|
|
||||||
maxContainers: 1
|
|
||||||
startWithoutCode: true
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
zerops:
|
||||||
|
- setup: nginx
|
||||||
|
build:
|
||||||
|
os: alpine
|
||||||
|
deployFiles:
|
||||||
|
- nginx.conf
|
||||||
|
- index.html
|
||||||
|
- static/
|
||||||
|
run:
|
||||||
|
os: alpine
|
||||||
|
base: nginx@latest
|
||||||
|
prepareCommands:
|
||||||
|
- sudo apk update
|
||||||
|
- sudo apk add vim
|
||||||
|
ports:
|
||||||
|
- port: 80
|
||||||
|
httpSupport: true
|
||||||
|
envReplace:
|
||||||
|
target: index.html
|
||||||
|
delimiter: '%%'
|
||||||
|
siteConfigPath: nginx.conf
|
||||||
|
|
||||||
|
# - setup: app
|
||||||
|
# build:
|
||||||
|
# os: alpine
|
||||||
|
# base: go@1
|
||||||
|
# buildCommands:
|
||||||
|
# - go build -o app main.go
|
||||||
|
# cache: true
|
||||||
|
# deployFiles:
|
||||||
|
# - app
|
||||||
|
# run:
|
||||||
|
# os: alpine
|
||||||
|
# base: alpine@latest
|
||||||
|
# ports:
|
||||||
|
# - port: 8080
|
||||||
|
# httpSupport: true
|
||||||
|
# start: ./app
|
||||||
|
#
|
||||||
|
# - setup: static
|
||||||
|
# build:
|
||||||
|
# deployFiles:
|
||||||
|
# - index.html
|
||||||
|
# - static/
|
||||||
|
# run:
|
||||||
|
# os: alpine
|
||||||
|
# base: static@latest
|
||||||
|
# ports:
|
||||||
|
# - port: 80
|
||||||
|
# httpSupport: true
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
zerops:
|
|
||||||
- setup: app
|
|
||||||
build:
|
|
||||||
os: alpine
|
|
||||||
base:
|
|
||||||
- go@1
|
|
||||||
buildCommands:
|
|
||||||
- go build -o app main.go
|
|
||||||
cache: true
|
|
||||||
deployFiles:
|
|
||||||
- app
|
|
||||||
run:
|
|
||||||
os: alpine
|
|
||||||
base: alpine@latest
|
|
||||||
ports:
|
|
||||||
- port: 8080
|
|
||||||
httpSupport: true
|
|
||||||
start: ./app
|
|
||||||
|
|
||||||
- setup: static
|
|
||||||
build:
|
|
||||||
deployFiles:
|
|
||||||
- index.html
|
|
||||||
- static/
|
|
||||||
run:
|
|
||||||
os: alpine
|
|
||||||
base: static@latest
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
httpSupport: true
|
|
||||||
|
|
||||||
- setup: nginx
|
|
||||||
build:
|
|
||||||
deployFiles:
|
|
||||||
- index.html
|
|
||||||
- static/
|
|
||||||
- nginx.conf
|
|
||||||
addToRunPrepare:
|
|
||||||
-
|
|
||||||
run:
|
|
||||||
os: alpine
|
|
||||||
base: nginx@latest
|
|
||||||
prepareCommands:
|
|
||||||
- sudo apk update
|
|
||||||
- sudo apk add vim
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
httpSupport: true
|
|
||||||
siteConfigPath: nginx.conf
|
|
||||||
Reference in New Issue
Block a user