Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ENV PUB_DISABLE_FAILURE_BLOCKS=${PUB_DISABLE_FAILURE_BLOCKS}
COPY package.json ./

RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*
apt-get install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*

RUN bun install

Expand All @@ -34,11 +34,18 @@ RUN bun run build

FROM nginx:stable-alpine

RUN apk add --no-cache iproute2

EXPOSE 80/tcp

COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY ./nginx/default.conf.template /etc/nginx/conf.d/default.conf
COPY ./docker-entrypoint.sh /docker-entrypoint-custom.sh
RUN chmod +x /docker-entrypoint-custom.sh

COPY --from=builder /app/build /usr/share/nginx/html

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl --fail --silent --output /dev/null http://localhost || exit 1
CMD curl --fail --silent --output /dev/null http://localhost || exit 1

ENTRYPOINT ["/docker-entrypoint-custom.sh"]
CMD ["nginx", "-g", "daemon off;"]
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

if [ -f /proc/net/if_inet6 ] && ip -6 addr show lo >/dev/null 2>&1; then
sed -i 's/# IPV6_PLACEHOLDER/listen [::]:80;/' /etc/nginx/conf.d/default.conf
else
sed -i 's/# IPV6_PLACEHOLDER//' /etc/nginx/conf.d/default.conf
fi

exec /docker-entrypoint.sh "$@"
5 changes: 2 additions & 3 deletions nginx/default.conf → nginx/default.conf.template
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
server {
listen 80;
listen [::]:80;
# IPV6_PLACEHOLDER
server_name vert;

root /usr/share/nginx/html;
index index.html;

client_max_body_size 10M;

# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
Expand All @@ -19,4 +18,4 @@ server {
}

error_page 404 /index.html;
}
}