Skip to content

Commit ed0995c

Browse files
author
Diogo Ferraz
committed
feat(client): add Dockerfile, nginx SPA config, and dockerignore
1 parent 3b33893 commit ed0995c

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules
2+
dist
3+
.angular
4+
coverage
5+
.git
6+
.github
7+
.vscode
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
README.md

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:20-alpine AS build
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
RUN npm ci
7+
8+
COPY . .
9+
10+
ARG BUILD_CONFIGURATION=production
11+
RUN npm run build -- --configuration=${BUILD_CONFIGURATION}
12+
13+
FROM nginx:1.27-alpine AS runtime
14+
15+
COPY nginx.conf /etc/nginx/conf.d/default.conf
16+
COPY --from=build /app/dist/task-management-client/browser /usr/share/nginx/html
17+
18+
EXPOSE 80
19+
20+
CMD ["nginx", "-g", "daemon off;"]

nginx.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
server {
2+
listen 80;
3+
server_name _;
4+
5+
root /usr/share/nginx/html;
6+
index index.html;
7+
8+
location / {
9+
try_files $uri $uri/ /index.html;
10+
}
11+
12+
location = /healthz {
13+
access_log off;
14+
add_header Content-Type text/plain;
15+
return 200 "ok";
16+
}
17+
}

0 commit comments

Comments
 (0)