Other parts:
- Traefik 2.10 as revers-proxy in Docker (SSL in dev and prod)
- Nuxt 3 production-ready template in Docker (SPA/SSR)
- Django/DRF backend in Docker (based on django-cookiecutter)
- Add NuxtUI
- Add SEO modules
- Add
@vueuse/nuxt
,@nuxt/image-edge
,@nuxtjs/google-fonts
- Add registration/authentication (with
@pinia/nuxt
) - Add SPA mode with Nginx
- Copy
.env.example
and rename it to.env
- Install Node (version in
.nvmrc
) - 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=uniqe_name
- 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=example
- 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=example
- 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=tpl.local # same as DOMAIN in Traefik .env!
- Run Traefik container, then run Nuxt container with
docker compose build
anddocker compose up -d
Using this modes assumes that the
your-domain.com
is already bound to your server (A
records are configured) and Traefik container raised in production mode
- 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=example
- Uncomment
Mode 3
block:# Mode 3: For production with SSR COMPOSE_FILE=production.yml DOMAIN=your-domain.com
- Run container with
docker compose build
anddocker compose up -d
coming soon...
I made this template for myself, but it's awesom if it helps someone else. The settings are far from ideal, so fell free to make a pull request.