summaryrefslogtreecommitdiff
path: root/roles/apps/pigallery2/templates/pod-spec.yml.j2
blob: c47beb6f95480fadf100cca5c4891c969cd37016 (plain) (blame)
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
securityContext:
  allowPrivilegeEscalation: false
containers:
- name: pigallery2
  image: "bpatrik/pigallery2:{{ item.value.version }}"
  securityContext:
    runAsUser: {{ pigallery2_app_uid }}
    runAsGroup: {{ pigallery2_app_gid }}
  resources:
    limits:
      memory: "1Gi"
  volumeMounts:
  - name: config
    mountPath: /app/data/config
  - name: db
    mountPath: /app/data/db
  - name: tmp
    mountPath: /app/data/tmp
{% for mountpoint, images_path in item.value.images_paths.items() %}
  - name: images-{{ mountpoint }}
    mountPath: /app/data/images/{{ mountpoint }}
    readOnly: true
{% endfor %}
  env:
  - name: PORT
    value: "{{ item.value.port }}"
  - name: NODE_ENV
    value: production
  ports:
  - containerPort: {{ item.value.port }}
    hostPort: {{ item.value.port }}
    hostIP: 127.0.0.1
volumes:
- name: config
  hostPath:
    path: "{{ pigallery2_base_path }}/{{ item.key }}/config/"
    type: Directory
- name: db
  hostPath:
    path: "{{ pigallery2_base_path }}/{{ item.key }}/db/"
    type: Directory
- name: tmp
  hostPath:
    path: "{{ pigallery2_base_path }}/{{ item.key }}/tmp/"
    type: Directory
{% for mountpoint, images_path in item.value.images_paths.items() %}
- name: images-{{ mountpoint }}
  hostPath:
    path: "{{ images_path }}"
    type: Directory
{% endfor %}