Add demo on devcontainer
This commit is contained in:
@ -17,3 +17,5 @@ The examples folder contains several Docker examples.
|
||||
|
||||
|
||||
`examples/fullstack` is a basic example containing a backend NodeJS application with a React frontend as well as a Postgres Database. The project is set up so that you can do all development in dev containers. The `node_modules` folder for the backend is isolated from your host system and only exists inside the running container. For this reason, you will need to use a devcontainer in order to be able to get things like Intellisense and typings.
|
||||
|
||||
|
||||
|
BIN
assets/open-dev-container.m4v
Normal file
BIN
assets/open-dev-container.m4v
Normal file
Binary file not shown.
@ -19,6 +19,11 @@ The first time you run `docker compose up` it may take a few minutes as Docker w
|
||||

|
||||
|
||||
|
||||
## Developing
|
||||
When running the `compose` stack, the backend node_modules are isolated from your host system. This is common in dev environment setups. In this case it is advised to use a Dev container. The following video demonstrates starting a dev container by using the VSCode plugin.
|
||||
|
||||
<video src="../../assets/open-dev-container.m4v" controls></video>
|
||||
|
||||
### Proxying and routes
|
||||
You will notice that the backend is listening on `http://0.0.0.0:3333/` but the frontend is making requests to `/api/`. This is designed to mimic how you would deploy something like this in production where the backend would be behind a reverse proxy. Traefik has some really nice middleware that allows us to easily tell it to route requests destined for `/api` to `/`. The bit that handles that are these labels:
|
||||
|
||||
|
Reference in New Issue
Block a user