baikal-docker in subdir behind traefik - solved #199
uelpenichsa
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'm not sure if this belongs here, but I was struggling a lot to run the dockerized version of baikal in a subdir behind traefik, e.g. https://example.com/baikal/. I did a lot of duckduckgoing (and also googling) but found only solutions that seemed weird and/or often only worked for some people or I found users that had problems setting up my scenario successfully, too.
Thus, I want to share my approach here, that currently works flawlessly in a setup with an SSL server certificate and self-signed client certificates from my own CA.
I use the apache-based baikal image and use it as a basis to build a derived image. During docker build an "alias.conf" file is copied into the image, that contains only on line:
Alias "/baikal" "/var/www/baikal/html/"
Then the docker build process executes the a2enconf binary that enables the alias.conf file for apache. The baikal.Dockerfile has the following content:
FROM ckulka/baikal:latest
COPY alias.conf /etc/apache2/conf-available/
RUN /usr/sbin/a2enconf alias
The respective baikal labels in Traefik have to define the PathPrefix-Rule "/baikal" and the baikal service in the Dockerfile needs the build directives (baikal and the Dockerfile "baikal.Dockerfile" are in a subdir "/baikal" and not in the directory where docker-compose.yml is stored):
...
In addition, you have to change the request_uri parameter in baikal-confdir/baikal.yaml to
base_uri: '/baikal/'
This doesn't seem to be necessary for accessing https://example.com/baikal/ and /baikal/admin/ but for accessing https://example.com/baikal/dav.php it is required. Without this setting dav.php is searched in the root dir of the web server and not in /baikal.
That's it.
As of now I have not experienced any problems oder flaws with this approach.
Best regards
Sascha
Beta Was this translation helpful? Give feedback.
All reactions