Skip to content

Docker compose's PWD problem when using systemd #56

Closed

Description

@jusabatier

I tried to set up a systemd file to launch mergin at startup :

[Unit]
Description=Docker Compose Application Service
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/user/mergin
ExecStart=/usr/local/bin/docker-compose up -d
ExecStop=/usr/local/bin/docker-compose down
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

But when I try to launch the service, it complain about the nginx.conf file mount.
It try to mount it from the root, becouse of the ${PWD}used here : https://github.com/MerginMaps/mergin/blob/master/docker-compose.yml#L55

A solution is to replace it with the full path to the nginx.conf file.

I share it, maybe it could be useful to others.

Activity

  1. alhirzel commented on Nov 25, 2023

    @alhirzel
    Contributor

    I am encountering this as well when trying to launch the Mergin Maps server via docker compose using ansible. I have created #132 .

  2. tomasMizera commented on Dec 19, 2023

    @tomasMizera
    Collaborator

    Thanks guys for reporting and fixing this issue. @alhirzel we will merge your change once you sign the licence here: https://github.com/MerginMaps/server/blob/master/LICENSES/CLA-signed-list.md

  3. linked a pull request that will close this issueChange PWD to "." in docker-compose.yml #132on Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions