ruv commited on
Commit
b406dcc
·
verified ·
1 Parent(s): ec81104

Update .dotfiles/nginx.conf

Browse files
Files changed (1) hide show
  1. .dotfiles/nginx.conf +21 -47
.dotfiles/nginx.conf CHANGED
@@ -1,47 +1,21 @@
1
- # Use the official Node.js image as the base
2
- FROM node:18 AS build
3
-
4
- # Set the working directory inside the container
5
- WORKDIR /app
6
-
7
- # Copy the entire project to the working directory
8
- COPY . .
9
-
10
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
11
- apt-get install -y nodejs
12
-
13
- COPY package*.json ./
14
- COPY src ./src
15
- RUN npm install
16
- RUN npm install reactflow
17
-
18
- RUN npm run build
19
-
20
- # Use the official Nginx image as the base for serving the built files
21
- FROM nginx:stable-alpine
22
-
23
- # Create a non-root user
24
- RUN adduser --disabled-password --gecos '' nginx
25
-
26
- # Copy the built files from the previous stage to the Nginx HTML directory
27
- COPY --from=build --chown=nginx:nginx /app/dist /usr/share/nginx/html
28
-
29
- # Create the necessary directories and set permissions
30
- RUN mkdir -p /var/cache/nginx/client_temp && \
31
- mkdir -p /var/cache/nginx/proxy_temp && \
32
- mkdir -p /var/cache/nginx/fastcgi_temp && \
33
- mkdir -p /var/cache/nginx/uwsgi_temp && \
34
- mkdir -p /var/cache/nginx/scgi_temp && \
35
- chown -R nginx:nginx /var/cache/nginx
36
-
37
- # Copy the custom Nginx configuration file
38
- COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
39
-
40
- # Expose the desired port
41
- EXPOSE 7860
42
-
43
- # Switch to the non-root user
44
- USER nginx
45
-
46
- # Start Nginx when the container launches
47
- CMD ["nginx", "-g", "daemon off;"]
 
1
+ worker_processes 1;
2
+
3
+ events {
4
+ worker_connections 1024;
5
+ }
6
+
7
+ http {
8
+ include /etc/nginx/mime.types;
9
+ default_type application/octet-stream;
10
+
11
+ server {
12
+ listen 7860;
13
+ server_name localhost;
14
+
15
+ location / {
16
+ root /usr/share/nginx/html;
17
+ index index.html;
18
+ try_files $uri $uri/ /index.html;
19
+ }
20
+ }
21
+ }