Hello guys,
I need some help: I am trying to let my Kirby code run on a subdomain with a simpel container and image. I have some big issues to get it up and running. I have a working nginx config provided by jwilder the popular nginx reverse proxy image: link to image
My Dockerfile
looks like this (it is pretty much a copy from the cookbook, commented out what is related to apache since I am using nginx):
# Use offical ubuntu:20.04 image
FROM ubuntu:20.04
# Set timezone
ENV TZ=Europe/Berlin
# Set geographic area using above variable
# This is necessary, otherwise building the image doesn't work
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Remove annoying messages during package installation
ARG DEBIAN_FRONTEND=noninteractive
# Install packages: web server & PHP plus extensions
RUN apt-get update && apt-get install -y \
# apache2 \
# apache2-utils \
# ca-certificates \
php \
# libapache2-mod-php \
php-curl \
php-dom \
php-gd \
php-intl \
php-json \
php-mbstring \
php-xml \
php-zip && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy virtual host configuration from current path onto existing 000-default.conf
#COPY default.conf /etc/apache2/sites-available/000-default.conf
# Remove default content (existing index.html)
RUN rm /var/www/html/*
# Activate Apache modules headers & rewrite
#RUN a2enmod headers rewrite
# Change web server's user id to match local user, replace with your local user id
RUN usermod --uid 1000 www-data
# Tell container to listen to port 80 at runtime
EXPOSE 80
# Start Apache web server
#CMD [ "/usr/sbin/apache2ctl", "-DFOREGROUND" ]
docker-compose-yml
version: '3'
services:
webserver:
build: .
image: image_name
networks:
- proxy-tier
container_name: kirbyserver
ports:
- "8099:80"
environment:
- VIRTUAL_HOST=sub.domain.tld
- VIRTUAL_ROOT=/var/www/html
- VIRTUAL_NETWORK=nginx-proxy
- LETSENCRYPT_HOST=sub.domain.tld
- LETSENCRYPT_EMAIL=my@email.tld
volumes:
- /srv/www/production/sub.domain.tld:/var/www/html
env_file:
- ./id.env
networks:
proxy-tier:
external:
name: nginxproxy_default
The id.env
-file
USERID=1000
my root-user-id is 0 and I have read somewhere that in this case the id should be set to 1000. I have tried around many things in many days but without any luck. That is why I started this question. Any help is appreciated.
Thanks a lot!