build: move entrypoint out to separate file
parent
904e09a1da
commit
16077f0542
|
|
@ -24,30 +24,9 @@ FROM nginx:alpine AS runtime
|
|||
ARG ADD_NOINDEX_HEADER=false
|
||||
ENV ADD_NOINDEX_HEADER=$ADD_NOINDEX_HEADER
|
||||
|
||||
# Copy documentation
|
||||
# Copy documentation and entrypoint script
|
||||
COPY --from=builder /ghostty/zig-out/share/ghostty/doc/libghostty /usr/share/nginx/html
|
||||
|
||||
# Create entrypoint script
|
||||
RUN cat > /entrypoint.sh << 'EOF'
|
||||
#!/bin/sh
|
||||
if [ "$ADD_NOINDEX_HEADER" = "true" ]; then
|
||||
cat > /etc/nginx/conf.d/noindex.conf << 'INNER_EOF'
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
}
|
||||
}
|
||||
INNER_EOF
|
||||
|
||||
# Remove default server config
|
||||
rm -f /etc/nginx/conf.d/default.conf
|
||||
fi
|
||||
exec nginx -g "daemon off;"
|
||||
EOF
|
||||
|
||||
COPY src/build/docker/lib-c-docs/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
if [ "$ADD_NOINDEX_HEADER" = "true" ]; then
|
||||
cat > /etc/nginx/conf.d/noindex.conf << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
# Remove default server config
|
||||
rm -f /etc/nginx/conf.d/default.conf
|
||||
fi
|
||||
exec nginx -g "daemon off;"
|
||||
Loading…
Reference in New Issue