From a36c0dfdf74d60fae349f4beeed911f8e465e65d Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sat, 21 Feb 2026 19:51:17 +0000 Subject: [PATCH] Enable BuildKit in Drone API pipeline --- .drone.yml | 2 ++ frontend/Dockerfile | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 792d9f2..e4ab759 100644 --- a/.drone.yml +++ b/.drone.yml @@ -123,6 +123,8 @@ steps: - name: Build and test API image image: plugins/docker + environment: + DOCKER_BUILDKIT: 1 settings: username: viktorbarzin password: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index d3f1179..6b403a7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -40,13 +40,19 @@ WORKDIR /app COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf -RUN chown -R nginx:nginx /usr/share/nginx/html +# Configure nginx to run as non-root +RUN chown -R nginx:nginx /usr/share/nginx/html && \ + chown -R nginx:nginx /var/cache/nginx && \ + chown -R nginx:nginx /var/log/nginx && \ + touch /run/nginx.pid && chown nginx:nginx /run/nginx.pid && \ + sed -i 's/listen 80;/listen 8080;/' /etc/nginx/conf.d/default.conf && \ + sed -i 's/^user /#user /' /etc/nginx/nginx.conf USER nginx -EXPOSE 80 +EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1 + CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 CMD ["nginx", "-g", "daemon off;"]