A lightweight, fast HTTP file server written in Go
2.1K
A lightweight, fast HTTP file server written in Go that serves files with directory browsing, multiple theme support, WebDAV, and advanced features like concurrent ZIP downloads.
# Pull from Docker Hub
docker pull samzong/gofs:latest
# Run with current directory
docker run -p 8000:8000 -v $(pwd):/data:ro samzong/gofs:latest
# Run with custom directory
docker run -p 8000:8000 -v /path/to/files:/data:ro samzong/gofs:latest
version: '3'
services:
gofs:
image: samzong/gofs:latest
ports:
- "8000:8000"
volumes:
- /path/to/files:/data:ro
environment:
- GOFS_HOST=0.0.0.0
- GOFS_PORT=8000
- GOFS_THEME=advanced
apiVersion: apps/v1
kind: Deployment
metadata:
name: gofs
labels:
app: gofs
spec:
replicas: 1
selector:
matchLabels:
app: gofs
template:
metadata:
labels:
app: gofs
spec:
containers:
- name: gofs
image: samzong/gofs:latest
ports:
- containerPort: 8000
env:
- name: GOFS_HOST
value: "0.0.0.0"
- name: GOFS_PORT
value: "8000"
- name: GOFS_THEME
value: "advanced"
volumeMounts:
- name: data
mountPath: /data
readOnly: true
resources:
requests:
memory: "32Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "200m"
livenessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /readyz
port: 8000
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: data
hostPath:
path: /path/to/files
type: Directory
---
apiVersion: v1
kind: Service
metadata:
name: gofs
spec:
selector:
app: gofs
ports:
- port: 80
targetPort: 8000
type: ClusterIP
apiVersion: v1
kind: ConfigMap
metadata:
name: gofs-config
data:
GOFS_DIR: "/config:/etc:ro:Configuration;/logs:/var/log::App Logs;/data:/app/data::Application Data"
GOFS_THEME: "advanced"
GOFS_SHOW_HIDDEN: "false"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gofs-multi
spec:
replicas: 1
selector:
matchLabels:
app: gofs-multi
template:
metadata:
labels:
app: gofs-multi
spec:
containers:
- name: gofs
image: samzong/gofs:latest
ports:
- containerPort: 8000
envFrom:
- configMapRef:
name: gofs-config
volumeMounts:
- name: config-volume
mountPath: /etc
readOnly: true
- name: logs-volume
mountPath: /var/log
readOnly: true
- name: data-volume
mountPath: /app/data
readOnly: true
volumes:
- name: config-volume
configMap:
name: app-config
- name: logs-volume
persistentVolumeClaim:
claimName: logs-pvc
- name: data-volume
persistentVolumeClaim:
claimName: data-pvc
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gofs-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/client-max-body-size: "100m"
spec:
tls:
- hosts:
- files.example.com
secretName: gofs-tls
rules:
- host: files.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gofs
port:
number: 80
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: gofs-stateful
spec:
serviceName: gofs-headless
replicas: 1
selector:
matchLabels:
app: gofs-stateful
template:
metadata:
labels:
app: gofs-stateful
spec:
containers:
- name: gofs
image: samzong/gofs:latest
ports:
- containerPort: 8000
env:
- name: GOFS_THEME
value: "advanced"
- name: GOFS_ENABLE_WEBDAV
value: "true"
volumeMounts:
- name: data-storage
mountPath: /data
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "500m"
volumeClaimTemplates:
- metadata:
name: data-storage
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: gofs-headless
spec:
clusterIP: None
selector:
app: gofs-stateful
ports:
- port: 8000
# values.yaml
image:
repository: samzong/gofs
tag: latest
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
targetPort: 8000
ingress:
enabled: true
className: nginx
annotations:
nginx.ingress.kubernetes.io/client-max-body-size: "100m"
hosts:
- host: files.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: gofs-tls
hosts:
- files.example.com
config:
theme: advanced
showHidden: false
enableWebdav: true
auth: "" # username:password format
persistence:
enabled: true
storageClass: ""
accessMode: ReadWriteOnce
size: 10Gi
mountPath: /data
resources:
requests:
memory: 64Mi
cpu: 100m
limits:
memory: 256Mi
cpu: 500m
nodeSelector: {}
tolerations: []
affinity: {}
GOFS_HOST - Host to bind (default: 0.0.0.0)GOFS_PORT - Port to bind (default: 8000)GOFS_THEME - Theme to use (default, advanced)GOFS_SHOW_HIDDEN - Show hidden files (true/false)GOFS_AUTH - Enable authentication (username:password)GOFS_ENABLE_WEBDAV - Enable WebDAV server (true/false)docker run -p 8000:8000 \
-v /etc:/config:ro \
-v /var/log:/logs:ro \
-e GOFS_DIR="/config:/etc:ro:Configuration;/logs:/var/log::App Logs" \
samzong/gofs:latest
latest - Latest stable releasev0.2.x - Specific version tagslinux/amd64, linux/arm64MIT License - see LICENSE for details.
Content type
Image
Digest
sha256:3df77c5ad…
Size
4.5 MB
Last updated
about 2 months ago
docker pull samzong/gofs