update dockerfile

This commit is contained in:
Salam-vsem
2025-05-19 15:07:30 +03:00
parent 1593c8a67b
commit c78aea5511
2 changed files with 10 additions and 25 deletions

View File

@@ -7,6 +7,9 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
env:
DOCKER_ORG: mibu-studio
DOCKER_LATEST: latest
runs-on: docker runs-on: docker
steps: steps:
# - name: Checkout code # - name: Checkout code
@@ -45,8 +48,8 @@ jobs:
linux/arm64 linux/arm64
push: true push: true
tags: | tags: |
${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
- name: Trigger Dokploy Deployment - name: Trigger Dokploy Deployment
run: | run: |

View File

@@ -1,8 +1,5 @@
# Build stage FROM node:lts AS build
FROM node:lts-alpine AS build
WORKDIR /app WORKDIR /app
# Install dependencies first to leverage Docker cache
COPY package*.json ./ COPY package*.json ./
RUN npm ci --no-audit --no-fund --omit=dev && \ RUN npm ci --no-audit --no-fund --omit=dev && \
npm cache clean --force npm cache clean --force
@@ -11,22 +8,7 @@ RUN npm ci --no-audit --no-fund --omit=dev && \
COPY . . COPY . .
RUN npm run build RUN npm run build
# Runtime stage FROM nginx:alpine AS runtime
FROM httpd:2.4-alpine AS runtime COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html
# Copy custom httpd config if needed EXPOSE 80
# COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
# Copy built assets from build stage
COPY --from=build /app/dist /usr/local/apache2/htdocs/
# Add security headers
# RUN echo 'Header set X-Content-Type-Options "nosniff"' >> /usr/local/apache2/conf/httpd.conf && \
# echo 'Header set X-Frame-Options "SAMEORIGIN"' >> /usr/local/apache2/conf/httpd.conf && \
# echo 'Header set X-XSS-Protection "1; mode=block"' >> /usr/local/apache2/conf/httpd.conf
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1