0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vue+docker-compose 環境構築

Last updated at Posted at 2019-09-23

環境構築 メモ

Dockerfile
FROM node:8-alpine

WORKDIR /app

RUN apk update && \
    npm install -g npm @vue/cli &&\
    npm install yarn  #今回はyarnを使用
docker-compose.yml
version: '3'
services:
  vue_app:
    build: ./docker
    ports:
      - 9000:9000
    volumes:
      - ./app:/app
    stdin_open: true
    tty: true
    command: /bin/sh
Workspaceにて
$ docker-compose build #build
$ docker-compose up -d
$ docker-compose exec {アプリ名} sh
# yarm add vue
# yarn global add @vue/cli
# vue ui -H 0.0.0.0 -p 9000  # cliのGUIツールを起動
                             #localhostではアクセスできないから注意

ブラウザで ”http://localhost:9000” と入力し表示できれば成功

参考記事 
dockerについて
vueの設定について
cliの使い方について

0
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?