You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The included `docker-compose.yaml` uses environment variables with sensible defaults. You can customize the configuration by creating a `.env` file:
200
201
201
202
```bash
203
+
# Create directories with proper permissions
204
+
mkdir -p files logs
205
+
chmod 755 files logs
206
+
202
207
# Copy the example environment file
203
208
cp .env.example .env
204
209
@@ -215,6 +220,39 @@ docker-compose up -d
215
220
-**Log file**: `/logs/access.log` (mapped to `./logs` on host)
216
221
-**Port mapping**: `8080:8080` (customizable via `LSGET_PORT` env var)
217
222
223
+
**Security & Permissions:**
224
+
225
+
The Docker image uses **Google's Distroless base** for maximum security:
226
+
- ✅ **10.9MB** image size (65% smaller than Alpine)
227
+
- ✅ No shell, no package manager
228
+
- ✅ Minimal attack surface
229
+
- ✅ Runs as non-root user (UID 65532)
230
+
231
+
**Permission Setup for Volumes:**
232
+
233
+
Since the container runs as UID 65532 (`nonroot` user), mounted volumes must be writable:
234
+
235
+
```bash
236
+
# Create directories with proper permissions
237
+
mkdir -p files logs
238
+
239
+
# Option 1: World-writable (simple, less secure)
240
+
chmod 777 files logs
241
+
242
+
# Option 2: Specific ownership (more secure)
243
+
sudo chown -R 65532:65532 files logs
244
+
245
+
# Option 3: Your user + group write (best for dev)
246
+
sudo chown -R $(id -u):$(id -g) files logs
247
+
chmod 775 files logs
248
+
```
249
+
250
+
**For Coolify/Platform Deployments:**
251
+
252
+
Most platforms handle permissions automatically. If you encounter issues:
253
+
- Coolify: Volume permissions are usually handled by the platform
254
+
- Ensure the deployment user has write access to mount paths
255
+
218
256
**Example 1: Simple setup (no baseurl needed):**
219
257
220
258
```bash
@@ -260,6 +298,55 @@ docker-compose down
260
298
docker-compose up -d --build
261
299
```
262
300
301
+
**Testing Docker locally with Taskfile:**
302
+
303
+
```bash
304
+
# Build and test Docker image (quick version check)
305
+
task docker-test
306
+
307
+
# Build Docker image
308
+
task docker-build
309
+
310
+
# Run Docker container interactively
311
+
task docker-run
312
+
313
+
# Start with docker-compose
314
+
task docker-compose-up
315
+
316
+
# View docker-compose logs
317
+
task docker-compose-logs
318
+
319
+
# Stop docker-compose
320
+
task docker-compose-down
321
+
322
+
# Rebuild and restart docker-compose
323
+
task docker-compose-rebuild
324
+
```
325
+
326
+
### Vendored Dependencies
327
+
328
+
To enhance security and reduce supply chain attacks, JavaScript dependencies are vendored locally:
329
+
330
+
**Go dependencies**: lsget has **zero direct Go dependencies** - it uses only the Go standard library. All dependencies in `go.mod` are indirect and only for development tools (air, golangci-lint).
331
+
332
+
**JavaScript dependencies**: The following libraries are vendored locally and embedded in the binary:
0 commit comments