-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontainer-spec.yaml
More file actions
60 lines (60 loc) · 1.83 KB
/
Copy pathcontainer-spec.yaml
File metadata and controls
60 lines (60 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
spec:
# PERMISSION FIX: Use initContainer to set proper ownership
initContainers:
- name: fix-permissions
image: alpine:latest
command: ['sh', '-c']
args:
- |
echo "Fixing permissions for factorio data directory..."
chown -R 845:845 /data/factorio
chmod -R 755 /data/factorio
echo "Permissions fixed successfully"
volumeMounts:
- name: factorio-data
mountPath: /data/factorio
securityContext:
runAsUser: 0 # Run as root to fix permissions
containers:
- name: factorio
image: jarnotmichal/factorio-with-http-controls:2.0.55-7
imagePullPolicy: Always
ports:
- containerPort: 34197
protocol: UDP
- containerPort: 27015
protocol: TCP
- containerPort: 8080
protocol: TCP
env:
- name: FACTORIO_SERVER_NAME
value: "${server_name}"
- name: FACTORIO_SERVER_DESCRIPTION
value: "${server_description}"
- name: FACTORIO_MAX_PLAYERS
value: "${max_players}"
- name: FACTORIO_ADMIN_USERS
value: '${admin_users}'
- name: FACTORIO_SAVE_NAME
value: "default"
- name: FACTORIO_AUTOSAVE_INTERVAL
value: "${autosave_interval}"
- name: FACTORIO_AUTOSAVE_SLOTS
value: "${autosave_slots}"
- name: PORT
value: "8080"
volumeMounts:
- name: factorio-data
mountPath: /data/factorio
restartPolicy: Always
securityContext:
runAsUser: 845
runAsGroup: 845
fsGroup: 845
# Additional security context to ensure proper permissions
fsGroupChangePolicy: "Always"
volumes:
- name: factorio-data
hostPath:
path: /mnt/stateful_partition/factorio
type: DirectoryOrCreate