Rename folder for clarity
@ -11,12 +11,16 @@ This is a practical example of a "basic" fullstack application. This applicatio
|
|||||||
### Devcontainer
|
### Devcontainer
|
||||||
You can run this project via dev containers. First you will need to ensure that you have the [VSCode dev containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
You can run this project via dev containers. First you will need to ensure that you have the [VSCode dev containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
||||||
|
|
||||||
Once that is installed you can simply open this folder in VSCode. After a few seconds it should prompt you to reopen in a dev container. If not, you can use the Command pallete and search for `Dev Containers: Open Folder in Dev Container`
|
Once you have the extension installed, there are a couple ways to get started. From this directory run `code .` to open a new VSCode window targeting this directory. After a few seconds you should get a notification in the bottom right asking if you want to reopen the workspace in a container. This will open a new VScode window and will start the process of building and running all of the containers.
|
||||||
|
|
||||||
Clone the repo and `cd` into the `compose` directory.
|
Another method is to open the `Command Pallete` (CMD+Shift+P) and search for `Dev Containers: Open Folder in Dev Container`. Select this folder and VScode will open a new window and kick off the process. The very first time you do this it will take several minutes to build the images and start the containers.
|
||||||
|
|
||||||
|
Alternatively, you can also just use the compose files to start a stack and connect your VSCode instance to the backend container.
|
||||||
|
|
||||||
|
To do that, clone the repo and `cd` into this directory.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cp backend/.env.example backend/.env
|
cd examples/devcontainers
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -26,7 +30,7 @@ The first time you run `docker compose up` it may take a few minutes as Docker w
|
|||||||
|
|
||||||
|
|
||||||
## Developing
|
## 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.
|
When running the `compose` stack, the backend/frontend 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>
|
<video src="../../assets/open-dev-container.m4v" controls></video>
|
||||||
|
|
@ -12,11 +12,6 @@ ADD package.json package-lock.json ./
|
|||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
FROM deps AS develop
|
FROM deps AS develop
|
||||||
WORKDIR /app/backend
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
COPY .env.example /app/backend/.env
|
|
||||||
RUN chmod +x /entrypoint.sh
|
|
||||||
ENV NODE_ENV=development
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 170 KiB |