webservices-app/README.md

75 lines
2.1 KiB
Markdown
Raw Normal View History

# Webservices App
This is an app I'm creating to visualise data I've created (in JSON form) describing my self-hosted (professional, volunteer, & personal) webservices.
## Credits
Developed by Dave Lane, [Open Source Technologist](https://oerfoundation.org/about/staff/#Dave_Lane) at the [OER Foundation](https://oerfoundation.org). Many thanks to support from the Foundation for this exploratory work!
## Installing the Webservices App
2024-08-09 16:21:51 +12:00
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!):
2024-08-09 16:21:51 +12:00
git clone https://forge.magnificent.nz/lightweight/webservices-app.git webservices-app
2024-08-09 16:21:51 +12:00
then
2024-08-09 16:21:51 +12:00
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.
2024-08-09 16:21:51 +12:00
## Developing
Once you've created a project and installed dependencies, start a development server:
2024-08-09 16:21:51 +12:00
npm run dev
2024-08-09 16:21:51 +12:00
# or start the server and open the app in a new browser tab
npm run dev -- --open
2024-08-09 16:21:51 +12:00
## Building
To create a production version of your app:
npm run build
2024-08-09 16:21:51 +12:00
You can preview the production build with `npm run preview`.
## Deployment
### To set up your SvelteKit project, ensure that your svelte.config.js file has this line:
// import adapter from '@sveltejs/adapter-auto';
import adapter from '@sveltejs/adapter-node';
and then run
npm install
### To build a new image
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 deploy the new container
At the location you're running production, pull the updated container
docker-compose pull
To start it up (and tail the logs - CTRL-C to quit out of the logs without affecting running container)
2024-12-02 15:05:24 +13:00
docker-compose rm -sf && docker-compose up -d && docker-compose logs -f
### To clear out an old image (if it's running)
docker-compose down --remove-orphans --rmi 'all'