Using a custom puid:guid with docker doesn't work #1855

Closed
opened 2026-03-22 13:42:04 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @marouamghar on GitHub (Mar 19, 2023).

Description

Wen specifying the puid:guid with the user field with docker, both the api and the frontend don't deploy
The api starts failing with the error :
groupmod: /etc/group.8: Permission denied
The frontend fails with the error :
sed: can't create temp file '/usr/share/nginx/html/index.htmlXXXXXX': Permission denied

Vikunja Frontend Version

latest

Vikunja API Version

latest

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @marouamghar on GitHub (Mar 19, 2023). ### Description Wen specifying the puid:guid with the user field with docker, both the api and the frontend don't deploy The api starts failing with the error : `groupmod: /etc/group.8: Permission denied` The frontend fails with the error : `sed: can't create temp file '/usr/share/nginx/html/index.htmlXXXXXX': Permission denied` ### Vikunja Frontend Version latest ### Vikunja API Version latest ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Mar 20, 2023):

Can you share the full command you used?

@kolaente commented on GitHub (Mar 20, 2023): Can you share the full command you used?
Author
Owner

@marouamghar commented on GitHub (Mar 20, 2023):

  vikunja_db:
    container_name: vikunja_db
    image: postgres
    restart: always
    user: ${PUID}:${PGID} 
    volumes:
      - ${ROOT_DOCKER}/vikunja/postgres/data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=vikunja
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=password

  vikunja_api:
    container_name: vikunja_api
    image: vikunja/api
    user: ${PUID}:${PGID} 
    environment:
      VIKUNJA_DATABASE_TYPE: postgres
      VIKUNJA_DATABASE_HOST: vikunja_db
      VIKUNJA_DATABASE_PASSWORD: password
      VIKUNJA_DATABASE_USER: user
      VIKUNJA_DATABASE_DATABASE: vikunja
      VIKUNJA_SERVICE_JWTSECRET: secret
    volumes: 
      - ${ROOT_DOCKER}/vikunja/files:/app/vikunja/files
    depends_on:
      - vikunja_db
    restart: unless-stopped

  vikunja_frontend:
    container_name: vikunja_frontend
    image: vikunja/frontend
    user: ${PUID}:${PGID} 
    restart: unless-stopped
@marouamghar commented on GitHub (Mar 20, 2023): ``` vikunja_db: container_name: vikunja_db image: postgres restart: always user: ${PUID}:${PGID} volumes: - ${ROOT_DOCKER}/vikunja/postgres/data:/var/lib/postgresql/data environment: - POSTGRES_DB=vikunja - POSTGRES_USER=user - POSTGRES_PASSWORD=password vikunja_api: container_name: vikunja_api image: vikunja/api user: ${PUID}:${PGID} environment: VIKUNJA_DATABASE_TYPE: postgres VIKUNJA_DATABASE_HOST: vikunja_db VIKUNJA_DATABASE_PASSWORD: password VIKUNJA_DATABASE_USER: user VIKUNJA_DATABASE_DATABASE: vikunja VIKUNJA_SERVICE_JWTSECRET: secret volumes: - ${ROOT_DOCKER}/vikunja/files:/app/vikunja/files depends_on: - vikunja_db restart: unless-stopped vikunja_frontend: container_name: vikunja_frontend image: vikunja/frontend user: ${PUID}:${PGID} restart: unless-stopped ```
Author
Owner

@kolaente commented on GitHub (Mar 20, 2023):

That won't work because Vikunja starts as root, changes the permissions and then drops its privileges. You can use the PUID and PGID env variables to change the uid and gid of the user running Vikunja, as documented here.

The frontend container does not support changing the user id as it runs as an unprivileged user and does not expose anything (volumes etc) to the host which would require different permissions.

@kolaente commented on GitHub (Mar 20, 2023): That won't work because Vikunja starts as root, changes the permissions and then drops its privileges. You can use the `PUID` and `PGID` env variables to change the uid and gid of the user running Vikunja, as documented [here](https://vikunja.io/docs/install-backend/#setting-user-and-group-id-of-the-user-running-vikunja). The frontend container does not support changing the user id as it runs as an unprivileged user and does not expose anything (volumes etc) to the host which would require different permissions.
Author
Owner

@marouamghar commented on GitHub (Mar 20, 2023):

That won't work because Vikunja starts as root, changes the permissions and then drops its privileges. You can use the PUID and PGID env variables to change the uid and gid of the user running Vikunja, as documented here.

The frontend container does not support changing the user id as it runs as an unprivileged user and does not expose anything (volumes etc) to the host which would require different permissions.

Thanks for the link, I missed it.
For the frontend container, yeah I arrived to that conclusion and didn't post the same issue on the other repo, but forgot to clean it here.

@marouamghar commented on GitHub (Mar 20, 2023): > That won't work because Vikunja starts as root, changes the permissions and then drops its privileges. You can use the `PUID` and `PGID` env variables to change the uid and gid of the user running Vikunja, as documented [here](https://vikunja.io/docs/install-backend/#setting-user-and-group-id-of-the-user-running-vikunja). > > The frontend container does not support changing the user id as it runs as an unprivileged user and does not expose anything (volumes etc) to the host which would require different permissions. Thanks for the link, I missed it. For the frontend container, yeah I arrived to that conclusion and didn't post the same issue on the other repo, but forgot to clean it here.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#1855