From 282cbf35c5e2ec817324a2ff04fd47a91f87e907 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Sat, 1 Jun 2024 12:16:39 -0400 Subject: [PATCH] Use neocities for hosting --- .zsignore | 2 +- Containerfile | 6 +++++- compose.yaml | 23 +++++++++++++++++++++-- readme.md | 17 ++--------------- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.zsignore b/.zsignore index 811950d..21637b5 100644 --- a/.zsignore +++ b/.zsignore @@ -5,4 +5,4 @@ data backing-up rss hooks -hooks +production.env diff --git a/Containerfile b/Containerfile index 168e849..d3b4515 100644 --- a/Containerfile +++ b/Containerfile @@ -2,5 +2,9 @@ FROM docker.io/prologic/zs AS build COPY . . RUN zs build --production +FROM docker.io/ruby:alpine AS deploy +RUN gem install neocities +COPY --from=build /data/.pub /pub + FROM docker.io/caddy/caddy:2.8-alpine -COPY --from=build /data /usr/share/caddy +COPY --from=build /data /srv diff --git a/compose.yaml b/compose.yaml index e68224c..3eb30c4 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,12 +1,31 @@ services: jonathan.is: image: jonathan.is + pull_policy: never build: context: . dockerfile: Containerfile restart: unless-stopped ports: - "8081:80" + - "8443:443" + - "8443:443/udp" volumes: - - ./.pub:/usr/share/caddy - - ./data:/data + - caddy_data:/data + - caddy_config:/config + deploy: + profiles: [ deploy ] + image: localhost/jonathan.is:deploy + pull_policy: never + env_file: + - production.env + build: + context: . + dockerfile: Containerfile + target: deploy + command: "neocities push --prune /pub" + +volumes: + caddy_data: + external: true + caddy_config: diff --git a/readme.md b/readme.md index b92b36b..1fc6f44 100644 --- a/readme.md +++ b/readme.md @@ -2,34 +2,21 @@ ## quickstart - $ ssh server "git clone --bare https://git.woodbine.nyc/micro/jonathan.is.git" - $ ssh server "cd jonathan.is.git && git show HEAD:hooks/post-receive > hooks/post-receive && chmod +x hooks/post-receive" - $ git remote add server ssh://server/~jonathan.is.git - $ git push server - ## manual install build - podman build . --tag jonathan.is + podman compose build run podman compose up - deploy - git push server + podman compose --profile deploy up deploy ## todo -### deploy -- [ ] git post-receive hook -> reload server -- [ ] proxy caddy behind nginx on digitalocean -- [ ] setup beta.jonathan.is dns to digitalocean - -- [ ] git pre-receive hook -> update post-receive hook - ### features - [ ] generate rss feed