Skip to content

Commit

Permalink
Add file-server service
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed May 9, 2024
1 parent 2ac110f commit f8738db
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ services:
template_path: templates/root-ndncert
render_path: dist/root-ndncert

file-server:
template_path: templates/file-server
render_path: dist/file-server

# Global variables that are available in all templates
globals:
ndnNetwork: /ndn
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,15 @@ services:
restart: unless-stopped
depends_on:
nfd: { condition: service_healthy }

file-server:
image: ghcr.io/yoursunny/ndn6-tools:20240505
init: true
volumes:
- ${PWD}/dist/file-server:/app:ro
- ${PWD}/dist/nlsr:/config
entrypoint: /bin/bash
command: /app/entrypoint.sh
restart: unless-stopped
depends_on:
nfd: { condition: service_healthy }
9 changes: 9 additions & 0 deletions templates/file-server/entrypoint.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -eu

# Change directory to script
cd "$(dirname "${BASH_SOURCE[0]}")"/..

# Run the file server
ndn6-file-server {{ default_prefix }}/file-server $(pwd)

0 comments on commit f8738db

Please sign in to comment.