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

Use tmpfs for mysql #1793

Open
attiks opened this issue Sep 1, 2023 · 1 comment
Open

Use tmpfs for mysql #1793

attiks opened this issue Sep 1, 2023 · 1 comment

Comments

@attiks
Copy link

attiks commented Sep 1, 2023

Description

For testing I want to use tmpfs to store mysql

I've change docksal.yml as follows

services:
  db:
    extends:
      file: ${HOME}/.docksal/stacks/services.yml
      service: mysql
    volumes:
      - project_root:/var/www:ro,nocopy,cached  # Project root volume (read-only)
      - db_data:/var/lib/mysql  # Database data volume
    tmpfs:
      - /var/lib/mysql:uid=999,gid=999

volumes:
  db_data:
    driver_opts:
      type: tmpfs
      device: tmpfs

But not sure if that's sufficient, anybody tried this before?

Inspect still shows

        "Mounts": [
            {
                "Type": "volume",
                "Name": "hrinfo_db_data",
                "Source": "/var/lib/docker/volumes/hrinfo_db_data/_data",
                "Destination": "/var/lib/mysql",
                "Driver": "local",
                "Mode": "z",
                "RW": true,
                "Propagation": ""
            },
            {
                "Type": "volume",
                "Name": "hrinfo_project_root",
                "Source": "/var/lib/docker/volumes/hrinfo_project_root/_data",
                "Destination": "/var/www",
                "Driver": "local",
                "Mode": "z",
                "RW": false,
                "Propagation": ""
            }
        ],
@attiks
Copy link
Author

attiks commented Sep 1, 2023

Deleted the DB container and volume and it seems to be working

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

1 participant