From bcef2c74033585ed0af4a279afd8e5e8e97d945c Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 21 Sep 2023 19:16:43 -0700 Subject: [PATCH] Added basic dockerfile for webserver --- Dockerfile | 14 ++++++++++++++ default | 31 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Dockerfile create mode 100644 default diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1aacafc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu AS node +RUN apt-get update +RUN apt-get install cargo npm -y +COPY ./site ./site +RUN cd /site && npm install + +FROM ubuntu +RUN apt-get update +RUN apt-get install nginx -y +COPY --from=node /site /var/www/html +COPY ./pkg /var/www/html/pkg +COPY default /etc/nginx/sites-enabled/default +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/default b/default new file mode 100644 index 0000000..ec6d36d --- /dev/null +++ b/default @@ -0,0 +1,31 @@ +types { + application/wasm wasm; + application/x-font-ttf ttc; + application/x-font-otf otf; + application/font-woff2 woff2; + font/ttf ttf; +} + + +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /var/www/html; + + # Add index.php to the list if you are using PHP + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + } + + location ~* .(js|css|ttf|ttc|otf|eot|woff|woff2)$ { + add_header access-control-allow-origin "*"; + expires max; + } +} \ No newline at end of file