Skip to content

Commit 4f3621b

Browse files
committed
Added docker configuration files and nginx
1 parent a8b19e7 commit 4f3621b

File tree

5 files changed

+71
-0
lines changed

5 files changed

+71
-0
lines changed

.dockerignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
docker
2+
scripts
3+
.git
4+
5+
# dependencies
6+
/node_modules
7+
8+
# profiling files
9+
chrome-profiler-events*.json
10+
speed-measure-plugin*.json
11+
12+
# IDEs and editors
13+
/.idea
14+
.project
15+
.classpath
16+
.c9/
17+
*.launch
18+
.settings/
19+
*.sublime-workspace
20+
21+
# IDE - VSCode
22+
.vscode/*
23+
!.vscode/settings.json
24+
!.vscode/tasks.json
25+
!.vscode/launch.json
26+
!.vscode/extensions.json
27+
.history/*
28+
29+
# misc
30+
/.sass-cache
31+
/connect.lock
32+
/coverage
33+
/libpeerconnection.log
34+
npm-debug.log
35+
yarn-error.log
36+
testem.log
37+
/typings
38+
39+
# System Files
40+
.DS_Store
41+
Thumbs.db

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
.env
23

34
# compiled output
45
/dist

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### STAGE 1: Build ###
2+
FROM node:14.8.0-alpine AS build
3+
WORKDIR /usr/src/app
4+
COPY package.json package-lock.json ./
5+
RUN npm install
6+
COPY . .
7+
RUN npm run build
8+
### STAGE 2: Run ###
9+
FROM nginx:1.19.2-alpine
10+
COPY nginx.conf /etc/nginx/nginx.conf
11+
COPY --from=build /usr/src/app/dist/frontend-ecommerce-angular /usr/share/nginx/html
12+
EXPOSE 80

nginx.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
events{}
2+
http {
3+
include /etc/nginx/mime.types;
4+
server {
5+
listen 80;
6+
server_name localhost;
7+
root /usr/share/nginx/html;
8+
index index.html;
9+
location / {
10+
try_files $uri $uri/ /index.html;
11+
}
12+
}
13+
}

scripts/build-docker.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
cd ..
3+
docker build -t victorgrubio/ecommerce-frontend-angular:1.0.0 .
4+
docker push victorgrubio/ecommerce-frontend-angular:1.0.0

0 commit comments

Comments
 (0)