Simplify startup
This commit is contained in:
@ -7,6 +7,12 @@ This is a practical example of a "basic" fullstack application. This applicatio
|
||||
- reverse_proxy - Traefik ingress controller handling reverse proxy for the frontend and backend applications.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### 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)
|
||||
|
||||
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`
|
||||
|
||||
Clone the repo and `cd` into the `compose` directory.
|
||||
|
||||
```shell
|
||||
@ -14,7 +20,7 @@ cp backend/.env.example backend/.env
|
||||
docker compose up
|
||||
```
|
||||
|
||||
The first time you run `docker compose up` it may take a few minutes as Docker will need to build images for the frontend and backend. Also there are some database migrations and seed data that need to happen. Those are handled by `backend/dev-entrypoint.sh`. This is handled for you automatically since it is baked into the image. Once everything is up you should be able to access the frontend at [http://app.docker.localhost:8888]() and the backend at [http://app.docker.localhost:8888/api]()
|
||||
The first time you run `docker compose up` it may take a few minutes as Docker will need to build images for the frontend and backend. Also there are some database migrations and seed data that need to happen. Those are handled by `backend/entrypoint.sh`. This is handled for you automatically since it is baked into the image. Once everything is up you should be able to access the frontend at [http://app.docker.localhost:8888]() and the backend at [http://app.docker.localhost:8888/api]()
|
||||
|
||||

|
||||
|
||||
|
@ -13,7 +13,7 @@ RUN npm ci
|
||||
|
||||
FROM deps AS develop
|
||||
WORKDIR /app/backend
|
||||
COPY dev-entrypoint.sh /entrypoint.sh
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
COPY .env.example /app/backend/.env
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENV NODE_ENV=development
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /app/backend
|
||||
cp .env.example .env
|
||||
echo "starting up..."
|
||||
node ace generate:key
|
||||
|
||||
|
@ -27,8 +27,6 @@ services:
|
||||
- "traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api"
|
||||
- "traefik.http.routers.backend.rule=Host(`app.docker.localhost`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.backend.middlewares=strip-api-prefix@docker"
|
||||
env_file:
|
||||
- ./backend/.env
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
Reference in New Issue
Block a user