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

Commit a441937

Browse files
committed
fix: update Docker Compose configuration to run container as root initially and set up storage directory with proper permissions
1 parent 2326586 commit a441937

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

compose.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ services:
1818
# Application Service
1919
stego-app:
2020
# Use the image built by the Spring Boot Maven plugin
21-
image: docker.io/noobdevsam/spring-project-steganography-tool:v1
21+
image: noobdevsam/spring-project-steganography-tool:v1
2222
container_name: stego-app
2323
ports:
2424
- "8080:8080"
2525
mem_limit: 2g
26-
user: "1000:1000" # Run as non-root user
26+
user: "0:0" # Run as root user initially
2727
environment:
2828
# Connect to the MySQL container
2929
- DATABASE_URL=jdbc:mysql://db-mysql:3306/stego
@@ -35,6 +35,14 @@ services:
3535
- JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=75.0
3636
volumes:
3737
- stego_storage:/app/storage
38+
command: >
39+
sh -c "
40+
mkdir -p /app/storage &&
41+
chown -R 1000:1000 /app/storage &&
42+
chmod -R 755 /app/storage &&
43+
cd /workspace &&
44+
exec setpriv --reuid=1000 --regid=1000 --clear-groups java org.springframework.boot.loader.launch.JarLauncher
45+
"
3846
networks:
3947
- stego-network
4048
depends_on:

0 commit comments

Comments
 (0)