aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/namespaces/snekbox/snekbox-forms/deployment.yaml
blob: bde867e6e8dfce4c35081828dda448ba31b94425 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: apps/v1
kind: Deployment
metadata:
  name: snekbox-forms
  namespace: snekbox
spec:
  replicas: 1
  selector:
    matchLabels:
      app: snekbox-forms
  template:
    metadata:
      labels:
        app: snekbox-forms
    spec:
      initContainers:
        - name: init-service
          image: busybox:latest
          command: ["/bin/sh", "-c"]
          args:
          - >
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/random.png -O /tmp/cj-inputs/random.png;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled1_order.txt -O /tmp/cj-inputs/shuffled1_order.txt;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled1.png -O /tmp/cj-inputs/shuffled1.png;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled4_order.txt -O /tmp/cj-inputs/shuffled4_order.txt;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled4.png -O /tmp/cj-inputs/shuffled4.png;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled8_order.txt -O /tmp/cj-inputs/shuffled8_order.txt;
            wget https://files.pydis.wtf/33649562-5739-4f23-9219-28fc236b86bc/shuffled8.png -O /tmp/cj-inputs/shuffled8.png;
            wget https://raw.githubusercontent.com/python-discord/snekbox/main/config/snekbox.cfg -O /tmp/config/snekbox.cfg;
            echo -e 'mount {\n src:"/snekbox/cj-inputs"\n dst:"/cj-inputs"\n is_bind: true\n rw: false}' >> /tmp/config/snekbox.cfg;
          volumeMounts:
            - name: snekbox-cj-inputs
              mountPath: /tmp/cj-inputs/
            - name: snekbox-forms-config
              mountPath: /tmp/config/
      containers:
        - name: snekbox-forms
          image: ghcr.io/python-discord/snekbox:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8060
          securityContext:
            privileged: true
          volumeMounts:
            - name: snekbox-forms-user-base-volume
              mountPath: /snekbox/user_base
            - name: snekbox-cj-inputs
              mountPath: /snekbox/cj-inputs
            - name: snekbox-forms-config
              mountPath: /snekbox/config/snekbox.cfg
              subPath: snekbox.cfg
          lifecycle:
            postStart:
              exec:
                command:
                  - "/bin/sh"
                  - "-c"
                  - >-
                    PYTHONUSERBASE=/snekbox/user_base
                    pip install --user --upgrade
                    pip
                    pillow==10.0.0
                    opencv-python-headless==4.8.0.74
      volumes:
        - name: snekbox-forms-user-base-volume
          emptyDir: {}
        - name: snekbox-cj-inputs
          emptyDir: {}
        - name: snekbox-forms-config
          emptyDir: {}