Skip to content

Commit

Permalink
using pre-build nginx:latest image, updated build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
secure-77 committed Sep 24, 2024
1 parent fac538d commit 71f937a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 46 deletions.
5 changes: 2 additions & 3 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ services:
- ./perlite/Demo:/var/www/perlite/Demo:ro

web:
build:
context: ./web
image: sec77/perlite_web:stable
image: nginx:stable
container_name: perlite_web-build
ports:
- 80:80
volumes:
- ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
- ./perlite:/var/www/perlite
- ./perlite/Demo:/var/www/perlite/Demo:ro
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ services:
- ./perlite/Demo:/var/www/perlite/Demo:ro

web:
build:
context: ./web
image: sec77/perlite_web:stable
image: nginx:stable
container_name: perlite_web
restart: unless-stopped
ports:
- 80:80
volumes:
- ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
volumes_from:
- perlite
depends_on:
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ services:
- ./perlite/Demo:/var/www/perlite/Demo:ro

web:
build:
context: ./web
image: sec77/perlite_web:stable
image: nginx:stable
container_name: perlite_web
restart: unless-stopped
ports:
- 80:80
volumes:
- ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
volumes_from:
- perlite
depends_on:
Expand Down
38 changes: 2 additions & 36 deletions perlite/.scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,58 +1,24 @@
#!/bin/bash

# update JS dependencies
# update dependencies

# force update on asset-packagist
curl https://asset-packagist.org/package/npm-asset/katex -D - >/dev/null
curl https://asset-packagist.org/package/npm-asset/vis-network -D - >/dev/null
curl https://asset-packagist.org/package/npm-asset/jquery -D - >/dev/null
curl https://asset-packagist.org/package/npm-asset/highlightjs--cdn-assets -D - >/dev/null

# composer clear-cache
# rm -rf vendor
composer update -v

# update highlight js
cp vendor/npm-asset/highlightjs--cdn-assets/highlight.min.js ../.js/
# update highlight css
cp vendor/npm-asset/highlightjs--cdn-assets/styles/atom-one-dark.min.css ../.styles/

# update jquery
cp vendor/npm-asset/jquery/dist/jquery.min.js ../.js/

# update katex
cp vendor/npm-asset/katex/dist/katex.min.js ../.js/
cp vendor/npm-asset/katex/dist/contrib/auto-render.min.js ../.js/
cp vendor/npm-asset/katex/dist/katex.min.css ../.styles/
cp -r vendor/npm-asset/katex/dist/fonts ../.styles/

# update mermaid
# cp vendor/npm-asset/mermaid/dist/mermaid.min.js ../.js/
# cp vendor/npm-asset/mermaid/dist/mermaid.min.js.map ../.js/

# update vis-network
cp vendor/npm-asset/vis-network/dist/vis-network.min.js ../.js/
cp vendor/npm-asset/vis-network/dist/vis-network.min.js.map ../.js/
cp vendor/npm-asset/vis-network/dist/dist/vis-network.min.css ../.styles/

# update Parsedown dependencie
cd ..
# composer clear-cache
# rm -rf vendor
composer update -v


#cp perlite/vendor/erusev/parsedown/Parsedown.php perlite/

# remove old container and images
# docker container rm perlite;
# docker container rm perlite_web;
# docker container rm perlite_web_dev;
# docker image rm sec77/perlite_web:stable;
# docker image rm sec77/perlite;
# docker image rm php;

# # rebuild and start
# cd perlite
# docker build -t sec77/perlite:latest . --network host;
# cd ..;
# docker-compose --file docker-compose.yml up
2 changes: 1 addition & 1 deletion perlite/.scripts/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "secure-77/perlite",
"description": "A web based markdown viewer optimized for Obsidian Notes",
"version": "1.5.8",
"version": "1.5.9",
"type": "project",
"keywords": ["markdown viewer","obsidian notes"],
"homepage": "https://github.com/secure-77/Perlite",
Expand Down

0 comments on commit 71f937a

Please sign in to comment.