Enable BuildKit in Drone API pipeline

This commit is contained in:
Viktor Barzin 2026-02-21 19:51:17 +00:00
parent aea4b3c008
commit a36c0dfdf7
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 11 additions and 3 deletions

View file

@ -123,6 +123,8 @@ steps:
- name: Build and test API image - name: Build and test API image
image: plugins/docker image: plugins/docker
environment:
DOCKER_BUILDKIT: 1
settings: settings:
username: viktorbarzin username: viktorbarzin
password: password:

View file

@ -40,13 +40,19 @@ WORKDIR /app
COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf 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 USER nginx
EXPOSE 80 EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ 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;"] CMD ["nginx", "-g", "daemon off;"]