Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted to load class "WebProfilerBundle" from namespace "Symfony\Bundle\WebProfilerBundle". when run in docker #151

Closed
Lxtharia opened this issue Mar 6, 2024 · 2 comments
Labels
question A question about Davis and how it works

Comments

@Lxtharia
Copy link

Lxtharia commented Mar 6, 2024

built the docker and ran it with this docker-compose file

version: "3.7"
name: "davis-docker"

services:

  nginx:
    image: nginx:1.23-alpine
    container_name: nginx
    command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
    depends_on:
      - davis
    volumes:
      - davis_www:/var/www/davis
      - type: bind
        source: ./configurations/davis.conf
        target: /etc/nginx/conf.d/default.conf
    ports:
      - 5050:80

  davis:
    build:
      context: ./repo/
      dockerfile: ./docker/Dockerfile
      args:
        fpm_user: 101:101
    image: davis:latest
    # If you want to use a prebuilt image from Github
    # image: ghcr.io/tchapi/davis:edge
    container_name: davis
    env_file: 
      - path: .env.local
    volumes:
      - davis_www:/var/www/davis
      - davis_data:/data

volumes:
  davis_www:
    name: davis_www
  davis_data:
    name: davis_data

and the .env.local:

# For the MariaDB container mainly
DB_ROOT_PASSWORD=notSoSecure

TIMEZONE=Europe/Berlin

# The Davis database, user and password
DB_DATABASE=davis
DB_USER=davis_user
DB_PASSWORD=davis_password

# For the Davis app
ADMIN_LOGIN=admin
ADMIN_PASSWORD=test

AUTH_REALM=SabreDAV
# Auth Method for the frontend
# "Basic", "IMAP", or "LDAP"
AUTH_METHOD=LDAP

# In case of LDAP Auth, you must specify the url of the LDAP server
# See https://www.php.net/manual/en/function.ldap-connect for more details
LDAP_AUTH_URL="ldap://127.0.0.1:389"
LDAP_DN_PATTERN="uid=%u"
LDAP_MAIL_ATTRIBUTE="mail"
LDAP_AUTH_USER_AUTOCREATE=false

CALDAV_ENABLED=true
CARDDAV_ENABLED=true
WEBDAV_ENABLED=false

WEBDAV_TMP_DIR='/tmp'
WEBDAV_PUBLIC_DIR='/webdav'

# INVITE_FROM_ADDRESS=no-reply@example.org
# MAIL_HOST=smtp.myprovider.com
# MAIL_PORT=587
# MAIL_USERNAME=userdav
# MAIL_PASSWORD=test
                                                                                                                                                                                                                                            

On the webinterface i get this error page:
06-032024_192458  firefox

Thanks in advance!

@tchapi
Copy link
Owner

tchapi commented Mar 7, 2024

Hi @Lxtharia

You're running in dev mode while it seems you have installed the packages in production mode (the WebProfilerBundle is not installed in production obviously)

Set APP_ENV=prod in your env.

@tchapi tchapi added the question A question about Davis and how it works label Mar 7, 2024
@Lxtharia
Copy link
Author

Lxtharia commented Mar 8, 2024

Thanks!
The real issue was that i assumed docker compose would automatically read .env.local files and as that didn't work, i used env_file and missed to copy some enviromental variables.

@Lxtharia Lxtharia closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about Davis and how it works
Projects
None yet
Development

No branches or pull requests

2 participants