When booting up a memgraph container, both on azure container apps with a mounted fileshare or locally, with a mounted volume, i get a permission denied error.
It works in my docker compose when i define a volume, that is not mounted.
i tried setting permissions, both in the command and in an entry script. e.g.:
<code>chmod -R 777 /var/lib/memgraph
</code>
<code>chmod -R 777 /var/lib/memgraph
</code>
chmod -R 777 /var/lib/memgraph
this does NOT work:
<code>services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- ./local_volume/memgraph/data:/var/lib/memgraph
- ./local_volume/memgraph/log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
</code>
<code>services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- ./local_volume/memgraph/data:/var/lib/memgraph
- ./local_volume/memgraph/log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
</code>
services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- ./local_volume/memgraph/data:/var/lib/memgraph
- ./local_volume/memgraph/log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
this works fine:
<code>services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- mg_lib:/var/lib/memgraph
- mg_log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
volumes:
mg_lib:
mg_log:
</code>
<code>services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- mg_lib:/var/lib/memgraph
- mg_log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
volumes:
mg_lib:
mg_log:
</code>
services:
app:
build:
context: .
dockerfile: app/Dockerfile
image: app:latest
container_name: app
volumes:
- ./local_volume/app:/mnt/data
ports:
- "8000:8000"
restart: always
environment:
- Environment=${Environment}
depends_on:
memgraph-mage:
condition: service_healthy
memgraph-mage:
image: memgraph/memgraph-mage
container_name: memgraph-mage
ports:
- "7687:7687"
- "7444:7444"
restart: always
volumes:
- mg_lib:/var/lib/memgraph
- mg_log:/var/log/memgraph
healthcheck:
test: ["CMD-SHELL", "echo 'RETURN 0;' | mgconsole || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 0s
environment:
- MEMGRAPH_USER=${MEM_USER}
- MEMGRAPH_PASSWORD=${MEM_PASSWORD}
networks:
default:
driver: bridge
volumes:
mg_lib:
mg_log:
How can i set a memgraph container inside an azure container app?