Skip to content

Commit 0d6c1b0

Browse files
committed
Agregar archivos de configuración de Docker y Nginx
1 parent acf21bd commit 0d6c1b0

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.dockerignore

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

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:alpine AS build
2+
WORKDIR /app
3+
COPY package*.json ./
4+
RUN npm install
5+
COPY . .
6+
RUN npm run build
7+
8+
FROM nginx:alpine AS runtime
9+
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
10+
COPY --from=build /app/dist /usr/share/nginx/html
11+
EXPOSE 8080

nginx/nginx.conf

Lines changed: 31 additions & 0 deletions
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)