fix port expose

parent 2edf7e8b
Pipeline #844 failed with stages
in 9 seconds
...@@ -7,7 +7,21 @@ RUN npm install ...@@ -7,7 +7,21 @@ RUN npm install
COPY . . COPY . .
RUN npm run build RUN npm run build
RUN npm install -g serve # Этап создания финального образа с Nginx
FROM nginx:alpine
# Удаляем стандартные файлы Nginx
RUN rm -rf /usr/share/nginx/html/*
# Копируем сгенерированные файлы React из предыдущего этапа
COPY --from=build /app/dist /usr/share/nginx/html
# Копируем конфигурацию Nginx
COPY nginx.conf /etc/nginx/nginx.conf
# Открываем порт 80 для доступа к приложению
EXPOSE 80 EXPOSE 80
CMD ["serve", "-s", "dist", "-l", "80"]
\ No newline at end of file # Запускаем Nginx
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
http {
server {
server_tokens off;
listen 8080;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
location / {
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_vary on;
gzip_http_version 1.0;
gzip_comp_level 5;
gzip_types
application/javascript
application/json
application/xml
font/opentype
image/svg+xml
text/css
text/plain
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 256;
gunzip on;
}
}
events{}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment