From d7f2ad84275acd2e77c6fb855fd3c8db0094072a Mon Sep 17 00:00:00 2001 From: Dave Lane Date: Thu, 29 Aug 2024 12:04:45 +1200 Subject: [PATCH] refining Docker deployment process, including self-hosting --- README.md | 35 +++++++++++++++++------------------ docker-compose.yml | 6 +++--- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index bbfb2b1..4c521a9 100644 --- a/README.md +++ b/README.md @@ -3,40 +3,35 @@ This is an app I'm creating to visualise data I've created (in JSON form) describing my self-hosted (professional, volunteer, & personal) webservices. -## create-svelte +## Installing the Webservices App -Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). +You can clone this repository from my [Forgejo instance](https://forge.magnificent.nz) using this command (replacing the latter webservices-app with your preferred directory name!): -## Creating a project + git clone https://forge.magnificent.nz/lightweight/webservices-app.git webservices-app -If you're seeing this, you've probably already done this step. Congrats! +then -```bash -# create a new project in the current directory -npm create svelte@latest + cd webservices-app + npm install + +or, if you're using pnpm, use `pnpminstall` or for yarn, `yarn`. That will install the svelte and other javascript dependencies. -# create a new project in my-app -npm create svelte@latest my-app -``` ## Developing -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: +Once you've created a project and installed dependencies, start a development server: -```bash -npm run dev + npm run dev # or start the server and open the app in a new browser tab -npm run dev -- --open -``` + + npm run dev -- --open ## Building To create a production version of your app: -```bash -npm run build -``` + npm run build You can preview the production build with `npm run preview`. @@ -56,6 +51,10 @@ and then run docker-compose build +### You can push your new container to a docker container repository (I use my Forgejo instance!) + + docker push forge.magnificent.nz/lightweight/webservices-app:latest + ### To start it up (and tail the logs - CTRL-C to quit out of the logs without affecting running container) docker-compose up -d && docker-compose logs -f diff --git a/docker-compose.yml b/docker-compose.yml index 757ac22..fc7b6cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ # docker-compose.yml services: - external: - container_name: external + app: + container_name: webservices-app # The name of the image that will be created when building this container # Change this based on your app's name... - image: external-website:latest + image: forge.magnificent.nz/lightweight/webservices-app:latest build: context: . dockerfile: Dockerfile