adicion de archivos para publicacion

This commit is contained in:
2026-09-28 17:38:34 -06:00
parent 444706b78e
commit 2fe4209551
5 changed files with 83 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
# build stage
FROM node:20 as build-stage
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
# certificado SSL autofirmado
RUN apk add openssl;
RUN openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=Company, Inc./CN=mydomain.com" -addext "subjectAltName=DNS:mydomain.com" -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt;
EXPOSE 80
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+7
View File
@@ -0,0 +1,7 @@
version: "3"
services:
server:
restart: always
environment:
VIRTUAL_HOST: wiki.erendira.tresfactorial.com
+16
View File
@@ -0,0 +1,16 @@
version: "3"
services:
server:
build: .
networks:
- tfnetwork
logging:
driver: "json-file"
options:
max-size: 10m
max-file: 2
networks:
tfnetwork:
external: true
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
nginx -g "daemon off;";
+37
View File
@@ -0,0 +1,37 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_types application/javascript text/css;
server {
listen 80;
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
location / {
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}