Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit ebd81bc

Browse files
committed
fix: update Docker Compose configuration to run container as non-root user and use named volume for storage
1 parent b3956a1 commit ebd81bc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compose.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ services:
2323
ports:
2424
- "8080:8080"
2525
mem_limit: 2g
26+
user: "1000:1000" # Run as non-root user
2627
environment:
2728
# Connect to the MySQL container
2829
- DATABASE_URL=jdbc:mysql://db-mysql:3306/stego
@@ -33,11 +34,7 @@ services:
3334
# Other environment variables as needed
3435
- JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=75.0
3536
volumes:
36-
# Mount the local './storage' directory into the container.
37-
# This makes it easy to see generated files on your host machine.
38-
- ./storage:/app/storage
39-
command: >
40-
sh -c "mkdir -p /app/storage && chown -R cnb:cnb /app/storage && java -jar /workspace/BOOT-INF/lib/spring-project-steganography-tool-v1.jar"
37+
- stego_storage:/app/storage
4138
networks:
4239
- stego-network
4340
depends_on:
@@ -50,3 +47,5 @@ networks:
5047
volumes:
5148
mysql_data:
5249
driver: local
50+
stego_storage:
51+
driver: local

0 commit comments

Comments
 (0)