Skip to content

Commit 9139dd6

Browse files
committed
https://malcoded.com/posts/angular-docker/ followed this tutorial and got docker working! I pushed my first docker image. still need to use docker compose
1 parent b760d35 commit 9139dd6

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Stage 1
2+
FROM node:8.11.2-alpine as node
3+
4+
WORKDIR /usr/src/app
5+
6+
COPY package*.json ./
7+
8+
RUN npm install
9+
10+
COPY . .
11+
12+
RUN npm run build
13+
14+
# Stage 2
15+
FROM nginx:1.13.12-alpine
16+
17+
COPY --from=node /usr/src/app/dist /usr/share/nginx/html
18+
19+
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

nginx.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
server {
2+
listen 80;
3+
location / {
4+
root /usr/share/nginx/html;
5+
index index.html index.htm;
6+
try_files $uri $uri/ /index.html =404;
7+
}
8+
}

0 commit comments

Comments
 (0)