$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DockerでAngular開発
Search
rayyyy
January 11, 2019
0
460
DockerでAngular開発
rayyyy
January 11, 2019
Tweet
Share
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
2
2.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
110
Accessibility Awareness
sabderemane
0
18
Raft: Consensus for Rubyists
vanstee
141
7.2k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
290
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.7k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
28
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Chasing Engaging Ingredients in Design
codingconduct
0
77
It's Worth the Effort
3n
187
29k
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と連携するとすぐデプロイできます。 初心者なのでこれぐらいしかまだわかっていませんが 便利そうです
ご清聴ありがとうございました