Skip to content

Commit

Permalink
Merge pull request #6 from reload/simpler
Browse files Browse the repository at this point in the history
Remove own entrypoint.d -- just use nginx'
  • Loading branch information
arnested authored Jun 26, 2024
2 parents c4f2c64 + fa81911 commit 77aa9ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@ COPY /base /
RUN apk add --no-cache \
bash=~5 \
ca-certificates=~20240226 \
gnutls-utils=~3 \
tini=~0
gnutls-utils=~3

ARG workdir=/var/www
WORKDIR "${workdir}"

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]

ENTRYPOINT [ "/sbin/tini", "--", "/usr/local/bin/entrypoint" ]
CMD [ "nginx", "-g", "daemon off;" ]

##
# Drupal
##
Expand Down
4 changes: 4 additions & 0 deletions context/base/docker-entrypoint.d/10-first-virtual-host.envsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# shellcheck shell=sh

FIRST_VIRTUAL_HOST=$(echo "${VIRTUAL_HOST:-localhost}" | awk '{print $1;}')
export FIRST_VIRTUAL_HOST
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
#!/usr/bin/env bash
# shellcheck shell=sh

set -euo pipefail

FIRST_VIRTUAL_HOST=$(awk '{print $1;}' <<<"${VIRTUAL_HOST:-localhost}")
export FIRST_VIRTUAL_HOST

echo "export FIRST_VIRTUAL_HOST=${FIRST_VIRTUAL_HOST}" >>/docker-entrypoint.d/10-first_virtual_host.envsh
chmod +x /docker-entrypoint.d/10-first_virtual_host.envsh

mkdir -p /cert
mkdir -p /cert /etc/nginx/include.d

CERT="/cert/${FIRST_VIRTUAL_HOST:-localhost}.crt"
CERT_KEY="/cert/${FIRST_VIRTUAL_HOST:-localhost}.key"
CA_CERT="/rootCA/rootCA.pem"
CA_KEY="/rootCA/rootCA-key.pem"

# if [ ! -r "${CA_CERT}" ] || [ ! -r "${CA_KEY}" ]; then
# echo "No root certificate, skipping certificate generation"
# exit 0
# fi

IP_ADDRESS=$(hostname -i)
export IP_ADDRESS

Expand All @@ -43,5 +30,4 @@ if [ -r "${CA_CERT}" ]; then
/usr/sbin/update-ca-certificates
fi

mkdir -p /etc/nginx/include.d
envsubst </etc/ssl.conf.template >/etc/nginx/include.d/ssl.conf
5 changes: 0 additions & 5 deletions context/base/usr/local/bin/entrypoint

This file was deleted.

0 comments on commit 77aa9ad

Please sign in to comment.