This is just testing code for Nginx Unit so I can run a Svelte frontend with a FastAPI backend.
To Use:
-
Build image and Run
make
-
Run NodeJS app build
make build
-
Configure Unitd
make config
if there's an error, you can check the container logs:
docker logs unit -f
or exec into the container and look around:
docker exec -ti -w /www unit /bin/bash su - unit
-
Restart Apps (as needed) The apps will need to be restarted if using a mount and the code is changed on disk.
# nodejs make app_restart_node # fastapi make app_restart_fapi
or both
make app_restart
Some Reading:
- Nginx Unit - FastaPI Applications
- Nginx Unit - Express Applications
- Nginx Unit - NodeJS 16 Dockerfile
- Nginx Unit - Python3.10 Dockerfile
- Serving Static Files in Express
- Setup NodeJS to work with Svelte without worrying about cross domain issues (YouTube Video)
- SvelteKit Routing