fix: start web services in Portainer Swarm
All checks were successful
Build and deploy / Validate source (push) Successful in 7s
Build and deploy / Publish images and notify Portainer (push) Successful in 43s

This commit is contained in:
Cauê Faleiros
2026-09-18 12:02:31 -03:00
parent e3e37f674d
commit 7605ca9918
2 changed files with 5 additions and 12 deletions

View File

@@ -18,5 +18,10 @@ ENV WEB_INDEX=index.html PUBLIC_HOST=invalid.example S3_PUBLIC_ENDPOINT=https://
COPY --from=policy /build/default.conf.template /etc/nginx/templates/default.conf.template COPY --from=policy /build/default.conf.template /etc/nginx/templates/default.conf.template
COPY dtf-site.html /usr/share/nginx/html/index.html COPY dtf-site.html /usr/share/nginx/html/index.html
COPY local/static/ /usr/share/nginx/html/ COPY local/static/ /usr/share/nginx/html/
# The official entrypoint renders the server configuration at startup and Nginx
# writes its PID/cache files. Keep the service non-root while granting it
# ownership of only those runtime locations. This works in Docker Swarm,
# where the previous read-only/tmpfs combination was not mounted as expected.
RUN chown -R 101:101 /etc/nginx/conf.d /var/cache/nginx /run
USER 101:101 USER 101:101
EXPOSE 8080 EXPOSE 8080

View File

@@ -124,12 +124,6 @@ services:
published: ${SITE_PORT:-18080} published: ${SITE_PORT:-18080}
protocol: tcp protocol: tcp
mode: ingress mode: ingress
read_only: true
tmpfs:
- /tmp:uid=101,gid=101,mode=0750
- /var/cache/nginx:uid=101,gid=101,mode=0750
- /var/run:uid=101,gid=101,mode=0750
- /etc/nginx/conf.d:uid=101,gid=101,mode=0750
healthcheck: healthcheck:
test: [CMD-SHELL, 'wget -q --header="Host: $$PUBLIC_HOST" -O /dev/null http://127.0.0.1:8080/health'] test: [CMD-SHELL, 'wget -q --header="Host: $$PUBLIC_HOST" -O /dev/null http://127.0.0.1:8080/health']
interval: 15s interval: 15s
@@ -152,12 +146,6 @@ services:
published: ${KANBAN_PORT:-18081} published: ${KANBAN_PORT:-18081}
protocol: tcp protocol: tcp
mode: ingress mode: ingress
read_only: true
tmpfs:
- /tmp:uid=101,gid=101,mode=0750
- /var/cache/nginx:uid=101,gid=101,mode=0750
- /var/run:uid=101,gid=101,mode=0750
- /etc/nginx/conf.d:uid=101,gid=101,mode=0750
healthcheck: healthcheck:
test: [CMD-SHELL, 'wget -q --header="Host: $$PUBLIC_HOST" -O /dev/null http://127.0.0.1:8080/health'] test: [CMD-SHELL, 'wget -q --header="Host: $$PUBLIC_HOST" -O /dev/null http://127.0.0.1:8080/health']
interval: 15s interval: 15s