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
# Set timezone
# 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
# Install packages: web server & PHP plus extensions
RUN apt-get update && apt-get install -y \
# apache2 \
# apache2-utils \
# ca-certificates \
# libapache2-mod-php \
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
# Start Apache web server
#CMD [ "/usr/sbin/apache2ctl", "-DFOREGROUND" ]
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.
As I have mentioned there is a fully working nginx server which is configered as a reverse proxy so that one machine can handle many different urls. This is in fact already working. The docker-compose for the nginx is 100% just normal code from the linked jwilder image, nothing special about it but I will post it anyway:
I am now just trying to create a container in which I can let Kirby run. The nginx container will create the .conf file automatically so I just need a few lines for the docker-compose or the Dockerfile to actually get it to work. I am juts struggeling because the way I have posted my files it does not work. The container stops after a second.
Thank you. Any help to point me to a direction is appreciated.
Hm, it is still not clear to me what you are doing. At least I think the reason why your kirbyserver container immediatly stops is because you are not running anything in it.
Maybe you should be more detailed about your architecture, folder setup and files. I even do not understand your id.env file and your remarks about the UID of root because from what you have posted, you are not going to use it.
It is not clear to me what you have here. Is it a different machine somewhere on the same or another network or do you mean the docker container nginx-proxy? A reverse proxy is not needed just to handle many different URLs so there might be an other reason to use it?