mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
cha2524222fvdfа
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM node:18-alpine
|
||||
FROM node:18-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -10,4 +10,36 @@ RUN npm install
|
||||
COPY frontend/ .
|
||||
|
||||
# Build the app
|
||||
CMD ["npm", "run", "build"]
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy built files
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
# Create nginx config directory
|
||||
RUN mkdir -p /etc/nginx/conf.d
|
||||
|
||||
# Copy nginx configuration
|
||||
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Create required directories and set permissions
|
||||
RUN mkdir -p /var/cache/nginx \
|
||||
/var/cache/nginx/client_temp \
|
||||
/var/cache/nginx/proxy_temp \
|
||||
/var/cache/nginx/fastcgi_temp \
|
||||
/var/cache/nginx/uwsgi_temp \
|
||||
/var/cache/nginx/scgi_temp \
|
||||
/var/run \
|
||||
&& chmod 777 /var/cache/nginx \
|
||||
/var/cache/nginx/client_temp \
|
||||
/var/cache/nginx/proxy_temp \
|
||||
/var/cache/nginx/fastcgi_temp \
|
||||
/var/cache/nginx/uwsgi_temp \
|
||||
/var/cache/nginx/scgi_temp \
|
||||
/var/run
|
||||
|
||||
# Remove user directive from nginx config
|
||||
RUN sed -i '/user/d' /etc/nginx/nginx.conf
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
@@ -1,22 +0,0 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy configuration files
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Create required directories and set permissions
|
||||
RUN mkdir -p /var/cache/nginx \
|
||||
/var/cache/nginx/client_temp \
|
||||
/var/cache/nginx/proxy_temp \
|
||||
/var/cache/nginx/fastcgi_temp \
|
||||
/var/cache/nginx/uwsgi_temp \
|
||||
/var/cache/nginx/scgi_temp \
|
||||
/var/run \
|
||||
&& chmod -R 755 /var/cache/nginx \
|
||||
&& chmod -R 755 /etc/nginx \
|
||||
&& chown -R nginx:nginx /var/cache/nginx \
|
||||
&& chown -R nginx:nginx /etc/nginx
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
@@ -11,8 +11,8 @@ http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request"'
|
||||
'$status $body_bytes_sent "$http_referer"'
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
Reference in New Issue
Block a user