DefangLabs / DefangLabs/defang
Support local volumes
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 166
- Forks
- 24
- Avg merge
- 10h 8m
- Merged PRs (30d)
- 33
Description
Add support for locally mapped volumes. This could be implemented by building a sidecar image from the mapped files.
version: '3'
services:
nextjs:
restart: always
image: caddy:2.7.6
command: ["caddy", "file-server", "--root", "/static", "--listen", ":80"]
#x-defang-static-files: /static
volumes:
- ./:/static
ports:
- target: 80
published: 8000
mode: ingress
Currently this emits a warning.
Discussion on what we should do based on customer needs, when do we need volumes?
- Dumb static website case, i.e. snake game by vibe coder. Very rarely there is code should be served without a building step, i.e. typescript, react, nextjs etc. This is already covered by current static-website case, or the user would be having a dockerfile for building, which would not require volume mount
- Mounting large files at runtime to avoid building huge images, i.e. LLM models. This is no longer needed by the majority, as most people use hosted models
- Mounting a volume to read-write files: most likely application needs to persist state as files locally
- Due to software limitation, not able to use a remote database, or by design, i.e. NATS use case
- Due to inexperience: It is nearly impossible to share read/write files correctly amongst multiple instances, will not scale
As a result, the most useful volume mount support we can provide for our users are, single instance mount to a disk with RO/RW support. This may also be extended to covers case 1, where a dumb website could be served from it if we implement data copy to the volume.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the warning emitted for locally mapped volumes, then clarify whether the target is sidecar-built local files, single-instance disk mounts with read-only/read-write support, or both. Done should be demonstrated by the provided Compose example working without the current warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, go
- Domain
- cli, cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100