summaryrefslogtreecommitdiff
path: root/CONTAINER.md
diff options
context:
space:
mode:
Diffstat (limited to 'CONTAINER.md')
-rw-r--r--CONTAINER.md76
1 files changed, 76 insertions, 0 deletions
diff --git a/CONTAINER.md b/CONTAINER.md
new file mode 100644
index 0000000..b87d65d
--- /dev/null
+++ b/CONTAINER.md
@@ -0,0 +1,76 @@
1# FCTDrive Container Deployment
2
3This document explains how to build and run the FCTDrive application as a container.
4
5## Prerequisites
6
71. **Build the binaries locally first:**
8 ```bash
9 # Build the Rust CLI tool
10 just build # or: cargo build --release --target-dir target/
11
12 # Build the frontend (optional, done in container)
13 cd frontend && npm run build
14 ```
15
162. **Container runtime** (podman, docker, etc.)
17
18## Building the Container
19
20```bash
21# Build the container image
22podman build -t fctdrive:latest .
23
24# Or with docker
25docker build -t fctdrive:latest .
26```
27
28## Running the Container
29
30```bash
31# Run with volumes for persistent data
32podman run -d \
33 --name fctdrive \
34 -p 3000:3000 \
35 -v ./blobs:/app/blobs:Z \
36 -v ./data:/app/data:Z \
37 -e TINYAUTH_ENDPOINT=http://localhost:3001 \
38 -e TINYAUTH_PUBLIC_ENDPOINT=http://localhost:3001 \
39 -e FCTDRIVE_PATH=/app/data \
40 fctdrive:latest
41```
42
43## Environment Variables
44
45- `TINYAUTH_ENDPOINT` - Internal TinyAuth server URL
46- `TINYAUTH_PUBLIC_ENDPOINT` - Public TinyAuth server URL (for browser redirects)
47- `FCTDRIVE_PATH` - Path to the drive data directory
48- `NODE_ENV=production` (set automatically)
49- `HOSTNAME=0.0.0.0` (set automatically)
50
51## Volume Mounts
52
53- `/app/blobs` - Blob storage directory
54- `/app/data` - Drive metadata/database directory
55
56## Container Features
57
58- **Base image**: Fedora 42
59- **Runtime**: Node.js + npm
60- **Binary**: Pre-built `fctdrive` binary in PATH
61- **User**: Non-root user `fctdrive`
62- **Port**: 3000 (Next.js server)
63- **Build**: Production Next.js build
64
65## Security
66
67- Runs as non-root user (`fctdrive:fctdrive`)
68- Only production dependencies installed
69- Minimal attack surface with focused .containerignore
70
71## Development vs Production
72
73This container is designed for production deployment. For development:
74- Use `just dev` for hot-reloading
75- Mount source code as volumes
76- Use development dependencies \ No newline at end of file