Other parts:
- Copy
.env.example
and rename it to.env
- Install Node v18
- Install and activate all recomended
VSCode
extensions - Enable Take Over Mode:
Ctrl + Shift + P
(macOS:Cmd + Shift + P
).- Type
built
and selectExtensions: Show Built-in Extensions
. - Type
typescript
in the extension search box (do not remove@builtin
prefix). - Click the little gear icon of
TypeScript and JavaScript Language Features
, and selectDisable (Workspace)
.
- Install
yarn
:npm install --global yarn
- Install all packages
yarn
- Run
yarn typecheck
for type checking - Run
yarn lint
for linting
Choose one of .env
presets. HMR working in all modes.
To use
Mode 1
andMode 2
, a raised container from this repo with Traefik is required. Because an external network to which frontend and backend containers are connected is created in Traefik compose.
- No need for a Traefik container
- Set
uniqe
project nameCOMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 0
block:# Mode 0: As separate dev server on custom port COMPOSE_FILE=local.yml DOMAIN=localhost NUXT_DOCKER_PORT=3018 # custom port HMR_DOCKER_PORT=24678
- Run
docker compose build
anddocker compose up -d
- The Traefik container must be running in
Mode 1
- Set the project name same as
COMPOSE_PROJECT_NAME
in Traefik.env
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 1
block:# Mode 1: As dev server behind the Traefik with http # For Windows users: use `;` (semicolon) as separator - local.yml;local.traefik.yml COMPOSE_FILE=local.yml:local.traefik.yml DOMAIN=localhost # or another aliace for 127.0.0.1 declared in etc/hosts, but same as DOMAIN in Traefik .env!
- Run Traefik container, then run Nuxt container with
docker compose build
anddocker compose up -d
- The Traefik container must be running in
Mode 2
- Set the project name same as
COMPOSE_PROJECT_NAME
in Traefik.env
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 2
block:# Mode 2: As dev server behind the Traefik + SSL and custom domain # For Windows users: use `;` (semicolon) as separator - local.yml;local.traefik.yml;local.traefik.ssl.yml COMPOSE_FILE=local.yml:local.traefik.yml:local.traefik.ssl.yml DOMAIN=orders.local # same as DOMAIN in Traefik .env!
- Run Traefik container, then run Nuxt container with
docker compose build
anddocker compose up -d
- The Traefik container must be running in
Mode 3
on prod server - Copy
.env.example
and rename it to.env
on prod server - Set the project name same as
COMPOSE_PROJECT_NAME
in Traefik.env
COMPOSE_PROJECT_NAME=orders
- Uncomment
Mode 3
block:# Mode 3: For production with SSR COMPOSE_FILE=production.yml DOMAIN=orders.baikov.dev
- Run container with
docker compose build
anddocker compose up -d
coming soon...