diff --git a/cdn/README.md b/cdn/README.md new file mode 100644 index 0000000..9e91f45 --- /dev/null +++ b/cdn/README.md @@ -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 diff --git a/cdn/index.html b/cdn/index.html index 2b04838..1ff9200 100644 --- a/cdn/index.html +++ b/cdn/index.html @@ -3,30 +3,34 @@ CDN TEST -

TEST

+

STATIC

- direct static + direct: gopher

- cdn static - gopher + cdn: + gopher

- direct s3 - gopher -

-

- cdn s3 - gopher -

-

- fetch static + fetch cdn:

+
+ +

STORAGE

+

+ direct: + s3-image +

+

+ cdn: + s3-image +

+ - \ No newline at end of file + diff --git a/cdn/static/gopher_profilovka_1.png b/cdn/static/gopher_profilovka_1.png new file mode 100644 index 0000000..c7db68a Binary files /dev/null and b/cdn/static/gopher_profilovka_1.png differ diff --git a/cdn/static/gopher_profilovka_2.png b/cdn/static/gopher_profilovka_2.png new file mode 100644 index 0000000..4a169c7 Binary files /dev/null and b/cdn/static/gopher_profilovka_2.png differ diff --git a/cdn/zerops-service-import.yaml b/cdn/zerops-service-import.yaml new file mode 100644 index 0000000..d433a63 --- /dev/null +++ b/cdn/zerops-service-import.yaml @@ -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 diff --git a/cdn/zerops-service-import.yml b/cdn/zerops-service-import.yml deleted file mode 100644 index a83235a..0000000 --- a/cdn/zerops-service-import.yml +++ /dev/null @@ -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 diff --git a/cdn/zerops.yaml b/cdn/zerops.yaml new file mode 100644 index 0000000..b02b3ec --- /dev/null +++ b/cdn/zerops.yaml @@ -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 diff --git a/cdn/zerops.yml b/cdn/zerops.yml deleted file mode 100644 index d24bd1a..0000000 --- a/cdn/zerops.yml +++ /dev/null @@ -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