Update .dotfiles/nginx.conf
Browse files- .dotfiles/nginx.conf +21 -47
.dotfiles/nginx.conf
CHANGED
|
@@ -1,47 +1,21 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 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 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|