feat: nginx and docker upgrade

- add build stage to docker
- fix mime types for nginx
pull/3/head
lambda 1 year ago
parent 6bb357be47
commit 08e99bf8b5
Signed by: lambda
GPG Key ID: 07006F27729676AE

@ -1,10 +1,21 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM node:23 as build
WORKDIR /app
COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json
RUN npm install
COPY . .
RUN npm run build
FROM nginx:1.22.0-alpine FROM nginx:1.22.0-alpine
WORKDIR /var/www/ WORKDIR /var/www/
RUN mkdir -p /var/www/website RUN mkdir -p /var/www/website
COPY public /var/www/website COPY --from=build /app/public /var/www/website
COPY nginx/nginx.conf /etc/nginx/nginx.conf COPY nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 EXPOSE 80

@ -1,16 +1,14 @@
include /etc/nginx/modules_enabled/*.conf;
events { events {
worker_connections 1024; worker_connections 1024;
} }
http { http {
include /etc/nginx/mime.types;
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name radioiceberg.net www.radioiceberg.net localhost 127.0.0.1;
location / { location / {
root /var/www/website; root /var/www/website;
index index.html; index index.html;