Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions testContainerAngular/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
17 changes: 17 additions & 0 deletions testContainerAngular/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:8.11.2-alpine as node

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

FROM nginx:1.13.12-alpine

COPY --from=node /usr/src/app/dist /usr/share/nginx/html

COPY ./nginx.conf /etc/nginx/conf.d/default.conf
17 changes: 17 additions & 0 deletions testContainerAngular/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2.3'

services:
angular:
hostname: localhost
container_name: angular-container
build: .
ports:
- 8080:8080

nginx:
container_name: nginx-container
image: nginx:1.13.12-alpine
volumes:
- ./nginx_proxy.conf:/etc/nginx/conf.d/default.conf
ports:
- "80:80"
8 changes: 8 additions & 0 deletions testContainerAngular/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 8080;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
7 changes: 7 additions & 0 deletions testContainerAngular/nginx_proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://angular:8080/;
}
}