Skip to content

Commit b731137

Browse files
authored
Merge pull request #532 from arch-fan/docker-implementation
Docker implementation
2 parents 740be29 + 9a0da09 commit b731137

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
node_modules/
3+
.vscode/
4+
.github/

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM node:lts AS base
2+
WORKDIR /app
3+
4+
FROM base AS deps
5+
COPY package*.json ./
6+
RUN npm install
7+
8+
FROM base AS build
9+
COPY --from=deps /app/node_modules ./node_modules
10+
COPY . .
11+
RUN npm run build
12+
13+
FROM nginx:stable-alpine AS deploy
14+
COPY --from=build /app/dist /usr/share/nginx/html
15+
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
16+
17+
EXPOSE 8080

docker-compose.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
astrowind:
3+
build: .
4+
container_name: astrowind
5+
ports:
6+
- 8080:8080

nginx/nginx.conf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 8080;
10+
server_name _;
11+
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
include /etc/nginx/mime.types;
15+
16+
gzip on;
17+
gzip_min_length 1000;
18+
gzip_proxied expired no-cache no-store private auth;
19+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
20+
21+
error_page 404 /404.html;
22+
location = /404.html {
23+
root /usr/share/nginx/html;
24+
internal;
25+
}
26+
27+
location / {
28+
try_files $uri $uri/index.html =404;
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)