1
0
Fork 0

♻️ refactor(linkstack): migrate to named volume and simplify init script

- update docker-compose.yml to use named volume (linkstack_data) with bind mount to ./data directory
- remove complex container export logic from init.sh, replace with simple directory creation (mkdir -p ./data)
This commit is contained in:
pooneyy 2026-01-13 19:55:56 +08:00
parent 3cbf177036
commit 710c63246f
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

View File

@ -3,7 +3,7 @@ services:
image: linkstackorg/linkstack:latest
pull_policy: always
volumes:
- ./data:/htdocs
- linkstack_data:/htdocs
ports:
- ${PANEL_APP_PORT_HTTP}:80
container_name: ${CONTAINER_NAME}
@ -14,3 +14,11 @@ services:
networks:
1panel-network:
external: true
volumes:
linkstack_data:
name: ${CONTAINER_NAME}-data
driver: local
driver_opts:
type: none
device: ./data
o: bind

View File

@ -1,4 +1 @@
install -d -m 777 ./data
CONTAINER_ID=$(docker create --pull always linkstackorg/linkstack:latest)
docker export $CONTAINER_ID | tar -x -C ./data htdocs --strip-components=1
docker rm $CONTAINER_ID
mkdir -p ./data