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

Can't bind the /htdocs folder to outside of container #118

Open
jccbbb opened this issue Mar 5, 2024 · 2 comments
Open

Can't bind the /htdocs folder to outside of container #118

jccbbb opened this issue Mar 5, 2024 · 2 comments

Comments

@jccbbb
Copy link

jccbbb commented Mar 5, 2024

Hello,

I want to do some theme development and therefor being able to have the docker image up and running while editing my theme in /themes.

However I can't manage to bind the /htdocs in the docker container to the project folder i am using in WSL2.

Can anyone provide steps how to get access to this so I can open up the theme in an IDE?

@derpieler
Copy link

I am also unable to set up permanent storage. I can set up the /tmp directory, but not /htdocs. I have also tried to set UMASK PUID and PGID. Without success.

@maya329
Copy link

maya329 commented Jul 27, 2024

I have a workaround. Here are the steps I used.

Step 1: Launch the docker container with persistent docker volume:

services:
    linkstack:
        depends_on:
          - db
        image: 'linkstackorg/linkstack:latest'
        volumes:
          - linkstack_data:/htdocs
        environment:
          - TZ=Asia/Singapore
          - SERVER_ADMIN=
          - HTTP_SERVER_NAME=
          - HTTPS_SERVER_NAME=
          - LOG_LEVEL=info
          - PHP_MEMORY_LIMIT=512M
          - UPLOAD_MAX_FILESIZE=48M
        restart: always
        ports:
            - '80:80'

    db:
        image: mysql:8.0.24
        volumes:
          - ./db:/var/lib/mysql
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: 
          MYSQL_DATABASE:
          MYSQL_USER:
          MYSQL_PASSWORD: 
        security_opt:
          - seccomp:unconfined

volumes:
  linkstack_data:

Step 2: Find the location of the persistent storage within docker, do a sudo cp -rfp sudo cp -rfp /var/lib/docker/volumes/<volume>/_data <location on local disk>

Step 3: Update the docker-compose.yml with local persistent storage:

services:
    linkstack:
        depends_on:
          - db
        image: 'linkstackorg/linkstack:latest'
        volumes:
          - <location of folder copied from step 2>:/htdocs
        environment:
          - TZ=Asia/Singapore
          - SERVER_ADMIN=
          - HTTP_SERVER_NAME=
          - HTTPS_SERVER_NAME=
          - LOG_LEVEL=info
          - PHP_MEMORY_LIMIT=512M
          - UPLOAD_MAX_FILESIZE=48M
        restart: always
        ports:
            - '80:80'

    db:
        image: mysql:8.0.24
        volumes:
          - ./db:/var/lib/mysql
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: 
          MYSQL_DATABASE:
          MYSQL_USER:
          MYSQL_PASSWORD: 
        security_opt:
          - seccomp:unconfined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants