Sign inSign up

insight4upublic/webserver

By insight4upublic

•Updated over 1 year ago

basic apache webserver

Image
0

145

insight4upublic/webserver repository overview

⁠docker-webserver

Default apache webserver with configurable user+group

Insight4U Github commits Github last-commit Github stars Github issues Github open issues Docker Pulls Docker Stars Docker Image Size

Base webserver with 2 external volumes : /config & /www
/config holds all apache2 & php8.2 config files
/www is the entire webroot \

Github⁠ Dockerhub⁠

VariableDefaultDescription
APACHE_DOCUMENT_ROOT/wwwApache’s DocumentRoot
WEB_USERwww-dataLinux user Apache runs as
WEB_GROUPwww-dataLinux group Apache runs as
WEB_UID33UID to use (creates user if missing)
WEB_GID33GID to use (creates group if missing)
TZEurope/BrusselsTimezone for PHP (date.timezone)

minimal:

docker create \
      -p 4567:80 \
      -v /some/host/folder/www:/www \
      -v /some/host/folder/config:/config \
      trueosiris/webserver

more options:

docker create \
      -p 4567:80 \
      -v /some/host/folder/www:/www \
      -v /some/host/folder/config:/config \
      -e APACHE_DOCUMENT_ROOT=/www \
      -e PGID=983 \
      -e PUID=983 \
      -e TZ=Europe/Brussels \
      -e HOST_HOSTNAME=$(hostname) \
      -e HOST_IP=$(ip addr show enp0s3 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) \
      --name webserver  \
      --restart=unless-stopped \
      -v "/var/run/docker.sock:/var/run/docker.sock" \
      trueosiris/webserver

docker compose

x-volume-localtime:
  &etclocaltime
  type: 'bind'
  source: /etc/localtime
  target: /etc/localtime
  read_only: true
x-volume-webdefault-webroot:
  &webdefaultwebroot
  type: 'bind'
  source: ./web/default/www
  target: /www
  bind:
    create_host_path: true  
x-volume-webdefault-config:
  &webdefaultconfig
  type: 'bind'
  source: ./web/default/config
  target: /config
  bind:
    create_host_path: true

services:
  webserver:
    image: insight4upublic/webserver
    environment:
      - APACHE_DOCUMENT_ROOT=/www 
      - PGID=1000 
      - PUID=1000 
      - TZ=Europe/Brussels 
      - HOST_HOSTNAME=$(hostname) 
      - HOST_IP=$(ip addr show enp0s3 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) 

    restart: unless-stopped
    network_mode: bridge     
    volumes: 
      - <<: *etclocaltime
      - <<: *webdefaultwebroot 
      - <<: *webdefaultconfig 
    ports:
      - 8031:80  
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:80"]
      interval: 60s
      timeout: 10s
      retries: 5

Tag summary

Content type

Image

Digest

sha256:6a7b12999…

Size

176.4 MB

Last updated

over 1 year ago

docker pull insight4upublic/webserver