Install Vikunja using Docker-compose with apache

Hello,

I recently discovered Vikunja which seems to be an amazing software. So, I tried to install it using the docker-compose guideline but instead of using nginx as web server, I tried to replaced it with apache.

However, I have two main errors:

  • First error:
proxy_1     | [WARNING] WEB_DOCUMENT_ROOT does not exists with path "/app"!
proxy_1     | 
proxy_1     | AH00526: Syntax error on line 6 of /opt/docker/etc/httpd/conf.d/10-server.conf:
proxy_1     | DocumentRoot '/app' is not a directory, or is not readable
proxy_1     | 2022-06-28 20:34:34,255 INFO exited: apached (exit status 1; not expected)
  • Second error:
db_1        | 2022-06-28 20:34:35 5 [Warning] Access denied for user 'vikunja'@'172.18.0.4' (using password: YES)
proxy_1     | 2022-06-28 20:34:36,516 INFO spawned: 'apached' with pid 26

I created a apache.conf file where I put the following instructions:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot http://frontend:80
    RewriteEngine On
    RewriteRule ^\/?(favicon\.ico|assets|audio|fonts|images|manifest\.webmanifest|robots\.txt|sw\.js|workbox-.*|api|dav|\.well-known) - [L]
    RewriteRule ^(.*)$ /index.html [QSA,L]
</VirtualHost>

And the docker-compose file has the following instructions:

services:
  db:
    image: mariadb:10
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      MYSQL_ROOT_PASSWORD: supersecret
      MYSQL_USER: vikunja
      MYSQL_PASSWORD: secret
      MYSQL_DATABASE: vikunja
    volumes:
      - ./db:/var/lib/mysql
    restart: unless-stopped
  api:
    image: vikunja/api
    environment:
      VIKUNJA_DATABASE_HOST: db
      VIKUNJA_DATABASE_PASSWORD: secret
      VIKUNJA_DATABASE_TYPE: mysql
      VIKUNJA_DATABASE_USER: vikunja
      VIKUNJA_DATABASE_DATABASE: vikunja
    volumes:
      - ./files:/app/vikunja/files
    depends_on:
      - db
    restart: unless-stopped
  frontend:
    image: vikunja/frontend
    restart: unless-stopped
  proxy:
    image: webdevops/apache:latest
    ports:
      - 80:80
    volumes:
      - ./apache.conf:/etc/apache2/sites-available/vikunja.conf:ro
    depends_on:
      - api
      - frontend
    restart: unless-stopped

Thank you in advance for your help to solve those issues :slight_smile:

Your config looks like you’re trying to serve files from the frontend container via the apache proxy container. That won’t work, at least not like this. What you need instead is a proxy configuration to forward requests reaching the apache proxy container to the frontend and api container. Check out the example apache reverse proxy config, you should be able to take that as a starting point and adjust accordingly.

I’m curious, why do you want to use apache in another proxy container instead of one of the other ways to do it which are proven to work?

I found a tuto on the Internet which presented Vikunja and the way to install it via docker-compose. But I am not familiar with docker and I thought it was the opportunity to learn about docker.

So, as precaution, I wanted to avoid any interferences between apache which is running on my server and Vikunja using nginx.

I think the second issue I have is more related to the database and the privilege of the user vikunja.

Thank you for your reply, I will try your proposition. :slight_smile:

1 Like