diff --git a/services/frontend/Dockerfile b/services/frontend/Dockerfile index 12a44bd..3a5e2fd 100644 --- a/services/frontend/Dockerfile +++ b/services/frontend/Dockerfile @@ -7,6 +7,6 @@ RUN npm run build FROM nginx:stable-alpine COPY --from=build /build/build /usr/share/nginx/html -COPY --from=build /build/configs/nginx/nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 +COPY --from=build /build/configs/nginx/default.conf /etc/nginx/conf.d/default.conf +EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] diff --git a/services/frontend/configs/nginx/default.conf b/services/frontend/configs/nginx/default.conf new file mode 100644 index 0000000..1272468 --- /dev/null +++ b/services/frontend/configs/nginx/default.conf @@ -0,0 +1,20 @@ +# vi:syntax=nginx + +server { + listen 8080; + listen [::]:8080; + server_name localhost; + + charset utf-8; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file diff --git a/services/frontend/configs/nginx/localhost.conf b/services/frontend/configs/nginx/localhost.conf deleted file mode 100644 index 91d7479..0000000 --- a/services/frontend/configs/nginx/localhost.conf +++ /dev/null @@ -1,38 +0,0 @@ -# vi:syntax=nginx - -upstream django { - server backend:9000; -} - -server { - listen 80; - listen [::]:80; - server_name localhost; - - charset utf-8; - - location /static { - alias /home/server/static; - } - - location /admin { - uwsgi_pass django; - include /home/config/uwsgi/uwsgi_params; - } - - location /api { - uwsgi_pass django; - include /home/config/uwsgi/uwsgi_params; - } - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } -} \ No newline at end of file diff --git a/services/frontend/configs/nginx/nginx.conf b/services/frontend/configs/nginx/nginx.conf deleted file mode 100644 index 6e16d69..0000000 --- a/services/frontend/configs/nginx/nginx.conf +++ /dev/null @@ -1,43 +0,0 @@ -worker_processes 4; -pid /run/nginx.pid; - -events { - worker_connections 768; - # multi_accept on; -} - -http { - # Basic Settings - tcp_nopush on; - tcp_nodelay on; - #keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - access_log /var/log/nginx/access.log ; - - sendfile on; - #tcp_nopush on; - client_max_body_size 20M; - - keepalive_timeout 0; - - uwsgi_read_timeout 86400; - uwsgi_send_timeout 86400; - - # Gzip Settings - - gzip on; - gzip_disable "msie6"; - - map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } - - # Virtual Host Configs - include /etc/nginx/conf.d/*.conf; - #include /etc/nginx/sites-enabled/*; -} \ No newline at end of file diff --git a/services/frontend/configs/nginx/uwsgi_params b/services/frontend/configs/nginx/uwsgi_params deleted file mode 100644 index 0bdf13b..0000000 --- a/services/frontend/configs/nginx/uwsgi_params +++ /dev/null @@ -1,15 +0,0 @@ -uwsgi_param QUERY_STRING $query_string; -uwsgi_param REQUEST_METHOD $request_method; -uwsgi_param CONTENT_TYPE $content_type; -uwsgi_param CONTENT_LENGTH $content_length; - -uwsgi_param REQUEST_URI $request_uri; -uwsgi_param PATH_INFO $document_uri; -uwsgi_param DOCUMENT_ROOT $document_root; -uwsgi_param SERVER_PROTOCOL $server_protocol; -uwsgi_param HTTPS $https if_not_empty; - -uwsgi_param REMOTE_ADDR $remote_addr; -uwsgi_param REMOTE_PORT $remote_port; -uwsgi_param SERVER_PORT $server_port; -uwsgi_param SERVER_NAME $server_name; \ No newline at end of file