1
0
Fork 0
This commit is contained in:
Pim van den Berg 2022-10-20 13:42:52 +02:00
commit f1117d3bd5
5 changed files with 186 additions and 0 deletions

90
.drone.yml Normal file
View File

@ -0,0 +1,90 @@
kind: pipeline
type: docker
name: build
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- sleep 5 # give docker enough time to start
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- ./build.sh
when:
branch:
- master
event:
- push
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
command:
- dockerd-entrypoint.sh
- dockerd
- --host=unix:///var/run/docker.sock
- --mtu=1492
volumes:
- name: dockersock
temp: {}
trigger:
branch:
- master
event:
- push
---
kind: pipeline
type: docker
name: rebuild
steps:
- name: rebuild
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- sleep 5 # give docker enough time to start
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- ./rebuild.sh
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
command:
- dockerd-entrypoint.sh
- dockerd
- --host=unix:///var/run/docker.sock
- --mtu=1492
volumes:
- name: dockersock
temp: {}
trigger:
event:
- cron
cron:
- rebuild

31
Dockerfile Normal file
View File

@ -0,0 +1,31 @@
FROM debian:bookworm-slim
RUN set -eux && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
vim \
locales \
openssl \
ca-certificates \
net-tools \
curl \
apache2 \
libapache2-mpm-itk \
libapache2-mod-fcgid \
&& \
ln -sf /dev/stdout /var/log/apache2/access.log && \
ln -sf /dev/stderr /var/log/apache2/error.log && \
/usr/sbin/a2enmod remoteip rewrite proxy proxy_fcgi && \
rm -rf /var/lib/apt/lists/* && \
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
/usr/sbin/locale-gen && \
/usr/sbin/update-locale 'LANG=en_US.UTF-8'
EXPOSE 80/tcp
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
STOPSIGNAL SIGWINCH
HEALTHCHECK CMD netstat -tnlp | grep '0.0.0.0:80' || exit 1

42
README.md Normal file
View File

@ -0,0 +1,42 @@
# Apache2 ITK MPM Docker container
* Debian slim based image
* Apache 2 + ITK MPM
# Supported tags and respective `Dockerfile` links
- [`latest`](https://git.nethuis.nl/pommi/docker-apache2-itk/Dockerfile)
# Usage
## Environment variables
| Key | Format | Description |
| --- | --- | --- |
## docker run
```
$ docker run -it \
--name apache2-itk \
-p 8080:80 \
--cap-add=SYS_NICE \
--cap-add=DAC_READ_SEARCH \
pommib/apache2-itk:latest
```
## docker-compose
```
version: "3"
services:
apache2-itk:
container_name: apache2-itk
image: pommib/apache2-itk:latest
cap_add:
- SYS_NICE
- DAC_READ_SEARCH
ports:
- "8080:80/tcp"
```

9
build.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -ex
IMAGE=pommib/apache2-itk:latest
docker pull $IMAGE
docker pull debian:bookworm-slim
docker build --no-cache -t $IMAGE ./
docker push $IMAGE

14
rebuild.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
updates_available () {
docker pull "$1"
if test "$(docker run -it --rm "$1" /bin/sh -c 'apt -qqq update && apt -qq list --upgradable')" != ""; then
return 0
else
return 1
fi
}
if updates_available pommib/apache2-itk:latest; then
./build.sh
fi