From 01a8f18bae51a1c78732802a0a7b5b1d293e7232 Mon Sep 17 00:00:00 2001 From: Arif Hasanic Date: Sat, 30 Aug 2025 23:04:01 +0200 Subject: [PATCH] add nginx file to docker container --- Dockerfile | 12 ++++++++---- docker-compose.yml | 4 +++- nginx.conf | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index b397dfd..2185613 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ -FROM nginx - -COPY ./dist /usr/share/nginx/html +FROM oven/bun as builder +WORKDIR /app +COPY . . +RUN bun install +RUN bun run build +FROM nginx:alpine +COPY --from=builder /app/dist /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 80 - CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 288434f..0028ce9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: monitor-im-flur: - image: git.rivercry.com/wg/monitor-im-flur:latest + build: + context: . + dockerfile: Dockerfile ports: - "9123:80" restart: unless-stopped diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..a7fecc1 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,27 @@ +worker_processes 1; + +events { worker_connections 1024; } + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { + expires 1y; + log_not_found off; + } + } +}