Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM nginx:latest

ADD ./nginx.conf /etc/nginx/nginx.conf

RUN apt-get update && apt-get install --no-install-recommends -y \
vim procps curl less \
npm \
nodejs


ARG APP_HOME=/web

WORKDIR ${APP_HOME}

COPY ./ /web/


RUN npm ci


EXPOSE 80
77 changes: 77 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;

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;
#tcp_nopush on;

keepalive_timeout 65;

gzip on;

proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;

upstream backend {
server backend:80;
}

server {
listen 80;
server_name _;
client_max_body_size 100M;
root /web;
index index.html;

# redirecto to https
# location / {
# return 301 https://$server_name$request_uri;
# }
# }
#
# server {
# listen 443 ssl;
# server_name _;
# client_max_body_size 100M;
#
# ssl_certificate /etc/nginx/certs/local.crt;
# ssl_certificate_key /etc/nginx/certs/local.key;
# ssl_session_timeout 5m;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
# ssl_prefer_server_ciphers on;
#
location / {
try_files $uri $uri/ @proxy_to_backend;
root /web;
}

location @proxy_to_backend {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_redirect off;

proxy_pass http://backend;
}
}
}