Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DockerでAngular開発
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
rayyyy
January 11, 2019
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DockerでAngular開発
rayyyy
January 11, 2019
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
430
Documentation Writing (for coders)
carmenintech
77
5.5k
Six Lessons from altMBA
skipperchong
29
4.5k
A designer walks into a library…
pauljervisheath
211
25k
Done Done
chrislema
186
17k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Side Projects
sachag
456
43k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Music & Morning Musume
bryan
48
7.4k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
460
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Transcript
DockerでAngular開発 エイチーム新卒2年 ナバロ ライ
ココに立つまで ・いろいろな勉強会に興味あり ・LTも挑戦したい! ・学生の頃、Angular 2をめちゃくちゃ触った (現在のバージョン 7)
Angularをインストールするか
・・・
ローカルを汚したくないな
Docker環境でやろう
Docker環境構築得意な人〜✋
は〜い✋
成果物 GitHub https://github.com/rayyyy/angular-docker
Docker環境 要件 ・Angularや必要なコマンドはコンテナ内で実行 ・動作確認はブラウザでできるように ・コンテナ内のファイルはローカルのエディタで編集
Docker環境構築の流れ 1. Dockerfileの作成 2. docker-compose.ymlの作成 3. 便利なMakefile作成
Dockerfile 作成 FROM node:11.6.0 as build_env RUN npm install -g @angular/cli
WORKDIR /root/my-app # コンテナ内のファイルはローカルのエディタで編集するために # ローカルのファイルをコンテナ内のワーキングスペースにコピー COPY . /root/my-app/
docker-compose.yml 作成 version: '3.7' services: web_dev: build: context: . target: build_env
tty: true # 処理が終わってもコンテナが終了しないように ports: - "4200:4200" # ローカルでの動作確認用 volumes: - .:/root/my-app # コンテナのフォルダをローカルにマウントする
Dockerfile 作成 $ docker-compose up -d $ docker-compose exec web_dev bash
Makefile
all: rm build up ps build: docker-compose build --no-cache up:
docker-compose up -d --build exec: docker-compose exec web_dev bash Makefile 作成 ps: docker ps -a && echo "\n" docker-compose ps rm: docker-compose stop docker-compose rm -f
$ make up イコール $ docker-compose up -d
Angular環境完成したのでプロジェクト作成 $ docker-compose up -d or make up $ docker-compose
exec web_dev bash or make exec root@71ca9dfb0e43:~/my-app# ng new myApp root@71ca9dfb0e43:~/my-app# cd myApp/ root@71ca9dfb0e43:~/my-app/myApp# ng serve --host 0.0.0.0 http://localhost:4200/
None
Netlifyでデプロイ&ホスティング 詳しくは書きませんが GitHubと連携するとすぐデプロイできます。 初心者なのでこれぐらいしかまだわかっていませんが 便利そうです
ご清聴ありがとうございました