Skip to content

Commit

Permalink
use upstream cert-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEverling committed Nov 28, 2023
1 parent f017378 commit b63c1ef
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 426 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
docker login -u $DOCKER_USER -p $DOCKER_TOKEN
- name: Build
run: docker build . --tag bshp/walrus:latest --progress=plain
run: docker build . --pull --tag bshp/walrus:latest --progress=plain
- name: Push
run: |
docker push bshp/walrus:latest
41 changes: 23 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
FROM bshp/apache2:latest

MAINTAINER [email protected]
LABEL org.opencontainers.image.authors="[email protected]"

ARG PHP_VERSION=8.1
ARG SQL_VERSION=5.11.0

ENV PHP_TIMEZONE=America/North_Dakota/Center
ENV WALRUS_HOME=/etc/walrus
ENV WALRUS_BOOT=${WALRUS_HOME}/boot.ini
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_TIMEZONE=${OS_TIMEZONE}
ENV PHP_ERROR_LOG=/var/log/apache2/php_error.log
ENV PHP_MAX_EXECUTION_TIME=60
ENV PHP_MAX_INPUT_TIME=60
ENV PHP_MEMORY_LIMIT=128M
ENV PHP_POST_MAX_SIZE=8M
ENV PHP_UPLOAD_MAX_FILESIZE=8M
ENV SQL_VERSION=${SQL_VERSION}

RUN set eux; \
apt-get update && apt-get install --no-install-recommends -y \
gnupg \
wget --quiet "https://packages.microsoft.com/keys/microsoft.asc" -O- | gpg --dearmor -o /usr/share/keyrings/packages.microsoft.gpg; \
echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/ubuntu/${OS_BASE}/prod ${OS_CODENAME} main" \
| tee /etc/apt/sources.list.d/microsoft-prod.list > /dev/null; \
apt-get update && ACCEPT_EULA=Y apt-get install --no-install-recommends -y \
libaio1 \
libcurl4 \
libgss3 \
Expand All @@ -25,13 +31,14 @@ RUN set eux; \
libxslt1.1 \
libzip-dev \
locales \
msodbcsql18 \
odbcinst \
sassc \
unixodbc \
unixodbc-dev \
unzip \
zip \
php \
php${PHP_VERSION} \
libapache2-mod-php \
php-bcmath \
php-curl \
Expand Down Expand Up @@ -60,36 +67,34 @@ RUN set eux; \
php-xdebug; \
echo "; Custom PHP Settings" > /etc/php/01-custom.ini; \
ln -s /etc/php/01-custom.ini /etc/php/${PHP_VERSION}/apache2/conf.d/01-custom.ini; \
mkdir ${WALRUS_HOME} && chmod -R 0750 ${WALRUS_HOME}; \
echo "## Walrus Setup Initialization" > ${WALRUS_BOOT}; \
echo "WALRUS_PHP_VERSION=${PHP_VERSION}" >> ${WALRUS_BOOT}; \
echo "WALRUS_SQL_VERSION=${SQL_VERSION}" >> ${WALRUS_BOOT}; \
chmod -R a+x /usr/local/bin; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
echo "Finished installing base system";

RUN set eux; \
echo "Installing SQL Server PHP Extensions"; \
OS_BASE=$(sed -n 's/^VERSION_ID="\(.*\)"/\1/p' </etc/os-release); \
EXT_DIR=$(php-config --extension-dir); \
SQL_TMP="$(mktemp -d)"; \
OS_VERSION=$(echo "${OS_BASE}" | sed 's/[^0-9]*//g'); \
OS_CODENAME=$(sed -n 's/^VERSION_CODENAME=\(.*\)/\1/p' </etc/os-release); \
SQL_CAT=$(echo "${PHP_VERSION}" | sed 's/[^0-9]*//g'); \
wget --quiet "https://packages.microsoft.com/keys/microsoft.asc" -O- | gpg --dearmor -o /usr/share/keyrings/packages.microsoft.gpg; \
echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/ubuntu/${OS_BASE}/prod ${OS_CODENAME} main" \
| tee /etc/apt/sources.list.d/microsoft-prod.list > /dev/null; \
wget --quiet "https://github.com/microsoft/msphpsql/releases/download/v${SQL_VERSION}/Ubuntu${OS_VERSION}-${PHP_VERSION}.tar" -O $SQL_TMP/mssql.tar; \
tar -xf $SQL_TMP/mssql.tar -C $SQL_TMP --strip-components=1; \
mv $SQL_TMP/php_sqlsrv_${SQL_CAT}_nts.so $EXT_DIR/sqlsrv.so && mv $SQL_TMP/php_pdo_sqlsrv_${SQL_CAT}_nts.so $EXT_DIR/pdo_sqlsrv.so; \
mv $SQL_TMP/php_sqlsrv_${SQL_CAT}_nts.so $EXT_DIR/sqlsrv.so; \
mv $SQL_TMP/php_pdo_sqlsrv_${SQL_CAT}_nts.so $EXT_DIR/pdo_sqlsrv.so; \
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/${PHP_VERSION}/apache2/conf.d/sqlsrv.ini; \
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/${PHP_VERSION}/apache2/conf.d/pdo_sqlsrv.ini; \
rm -rf $SQL_TMP; \
printf "; priority=20\nextension=sqlsrv.so\n" > /etc/php/${PHP_VERSION}/mods-available/sqlsrv.ini; \
printf "; priority=30\nextension=pdo_sqlsrv.so\n" > /etc/php/${PHP_VERSION}/mods-available/pdo_sqlsrv.ini; \
phpenmod -v ${PHP_VERSION} sqlsrv pdo_sqlsrv; \
apt-get update && ACCEPT_EULA=Y apt-get install --no-install-recommends -y msodbcsql18; \
echo "Finished installing SQL Server PHP Extensions";

COPY ./src/ ./

RUN set eux; \
mkdir /var/log/php && chmod -R 0755 /var/log/php; \
chown root:root /usr/local/bin/entrypoint.sh; \
chmod a+x /usr/local/bin/entrypoint.sh;


EXPOSE 80 443

Expand Down
216 changes: 0 additions & 216 deletions src/etc/apache2/apache2.conf

This file was deleted.

7 changes: 0 additions & 7 deletions src/etc/apache2/conf-enabled/security.conf

This file was deleted.

21 changes: 0 additions & 21 deletions src/etc/apache2/mods-enabled/ssl.conf

This file was deleted.

15 changes: 0 additions & 15 deletions src/etc/apache2/ports.conf

This file was deleted.

16 changes: 0 additions & 16 deletions src/etc/apache2/sites-enabled/000-default.conf

This file was deleted.

Loading

0 comments on commit b63c1ef

Please sign in to comment.