Skip to content

Commit f326611

Browse files
feat: share entrypoint.sh between containers via shared volume
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <[email protected]>
1 parent 2690c46 commit f326611

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ WORKDIR /root/
2424
# Copy the binary from builder
2525
COPY --from=builder /app/main .
2626

27-
# Copy templates
27+
# Copy templates and entrypoint script
2828
COPY --from=builder /app/templates ./templates
29+
COPY --from=builder /app/entrypoint.sh ./entrypoint.sh
30+
31+
# Make entrypoint script executable
32+
RUN chmod +x ./entrypoint.sh
2933

3034
# Expose port
3135
EXPOSE 8080

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ services:
44
container_name: ollama
55
volumes:
66
- ollama_data:/root/.ollama
7-
- ./entrypoint.sh:/entrypoint.sh
7+
- shared_scripts:/shared
88
environment:
99
- OLLAMA_ORIGINS=*
1010
- OLLAMA_MODEL=gemma3:1b
11-
entrypoint: ["/bin/bash", "/entrypoint.sh"]
11+
entrypoint: ["/bin/bash", "/shared/entrypoint.sh"]
1212
restart: unless-stopped
1313
# Uncomment the following lines if you have a GPU
1414
# deploy:
@@ -28,9 +28,13 @@ services:
2828
- OLLAMA_HOST=http://ollama:11434
2929
- OLLAMA_MODEL=gemma3:1b
3030
- PORT=8080
31+
volumes:
32+
- shared_scripts:/shared
3133
depends_on:
3234
- ollama
3335
restart: unless-stopped
36+
command: sh -c "cp /root/entrypoint.sh /shared/ && ./main"
3437

3538
volumes:
3639
ollama_data:
40+
shared_scripts:

0 commit comments

Comments
 (0)