Build Nuxt TypeScript + Vuetify environment with docker-compose

Introduction

I usually touch Laravel, and I have never built a front-end environment with Docker, so I tried it. Build a Nuxt TypeScript + Vuetify front-end environment with docker-compose. Eventually, we plan to put laravel in the same repository as a backend in Monolipo. It is assumed that Docker and docker-compose are installed.

Execution environment

Directory structure

docker-compose.yml nuxt/ docker/ └ app/   └ Dockerfile

docker-compose

docker-compose.yml


version: "3"
services:
  app:
    build:
      context: ./
      dockerfile: ./docker/app/Dockerfile
    ports: 
      - "3000:3000"
    command: yarn run dev
    volumes:
      - ./nuxt:/nuxt

Dockerfile

FROM node:14.4.0-alpine

ENV HOME=/nuxt \
    LANG=C.UTF-8 \
    TZ=Asia/Tokyo \
    HOST=0.0.0.0

#Required to install Vuetify
RUN apk update && \
    apk upgrade && \
    apk add --no-cache make gcc g++ python


WORKDIR /nuxt

EXPOSE 3000

Build

$ docker-compose build

Installation of Nuxt and Vuetify

$ docker-compose run --rm app yarn create nuxt-app nuxt
...
...
create-nuxt-app v3.4.0
✨  Generating Nuxt.js project in nuxt
? Project name: `nuxt`
? Programming language: TypeScript
? Package manager: Yarn
? UI framework: Vuetify.js
? Nuxt.js modules: Axios (<=Note that it will not be selected unless you press the space key)
? Linting tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Testing framework: Jest
? Rendering mode: Single Page App
? Deployment target: Server (Node.js hosting)
? Development tools: (Press <space> to select, <a> to toggle all, <i> to invert selection)
? Continuous integration: None
? Version control system: None

Since various questions will be asked, select Vuetify.js in the UI framework column as described above. Note that some items will not be selected unless you press the space. After installation, the nuxt directory will look like this:

nuxt  ┣ .config/  ┗ nuxt/    ┣ asset/    ┣ ...    ┣ ...    ┣ package.json    ┗ yarn.loc

So move nuxt / nuxt / * to nuxt / and do the following

nuxt  ┣ .config/  ┣ asset/  ┣ ...  ┣ ...  ┣ package.json  ┗ yarn.loc

Start-up

$ docker-compose up -d

http://localhost:3000/ If you access and it is displayed as shown in the image below, it is completed for the time being! スクリーンショット 2020-10-13 10.57.19.png

There may be settings for tsconfig.json, but I'll write about it in Laravel's Sanctum and SPA authentication articles ...

Recommended Posts

Build Nuxt TypeScript + Vuetify environment with docker-compose
Build and manage RStudio environment with Docker-compose
Build docker environment with WSL
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Build a Tomcat 8.5 environment with Pleiades 4.8
Build PlantUML environment with VSCode + Docker
Build environment with vue.js + rails + docker
Build Rails environment with Docker Compose
Create Laravel environment with Docker (docker-compose)
Build jooby development environment with Eclipse
Build docker + laravel environment with laradock
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ MySQL edition ~
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Sequelize ~
Build a PureScript development environment with Docker
[Docker] Build Jupyter Lab execution environment with Docker
Build an environment with Docker on AWS
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker
Build a hot reload development environment with Docker-compose using Realize of Go
Build a Laravel / Docker environment with VSCode devcontainer
Build a WordPress development environment quickly with Docker
Build an E2E test environment with Selenium (Java)
Build Spring Boot project by environment with Gradle
[Win10] Build a JSF development environment with NetBeans
How to build an environment of [TypeScript + Vue + Express + MySQL] with Docker ~ Vue edition ~
Build mecab (NEologd dictionary) environment with Docker (ubuntu)
[Rails] How to build an environment with Docker
[First team development ②] Build an environment with Docker
Build a Java development environment with VS Code
Build Java development environment with VS Code on Mac
How to build docker environment with Gradle for intelliJ
Stable development environment construction manual for "Rails6" with "Docker-compose"
Easily build a Vue.js environment with Docker + Vue CLI
Build ruby debug environment with VS Code of Windows 10
[Note] Build a Python3 environment with Docker in EC2
Build Java development environment with WSL2 Docker VS Code
How to build Java development environment with VS Code
Build Rails (API) x MySQL x Nuxt.js environment with Docker
[Environment construction] Build a Java development environment with VS Code!
Build WordPress environment with Docker (Local) and AWS (Production)
Build Java program development environment with Visual Studio Code
[2021] Build a Docker + Vagrant environment for using React / TypeScript
Build Doma1 with Ant
Build Growai with Centos7
Build Java with Wercker
Build bazel with alpine
Build a "Spring Thorough Introduction" development environment with IntelliJ IDEA
A memo to build Jitsi Meet on Azure with docker-compose
Build a CentOS 8 virtual environment on your Mac with VirtualBox
Build mate desktop environment on ec2 with terraform (Ubuntu 20.04LTS)
Build a Node-RED environment with Docker to move and understand
Build WebAPP development environment with Java + Spring with Visual Studio Code