Add anki build script

This commit is contained in:
Pal Kerecsenyi 2024-01-08 15:23:50 +00:00
commit 2e4e857b37
Signed by: palk
GPG Key ID: 6891661E25394C2C
3 changed files with 88 additions and 0 deletions

6
.gitlab-ci.yaml Normal file
View File

@ -0,0 +1,6 @@
include:
- project: 'gitlab.palk.me/templates'
file: '/gitlab-ci/Paltiverse.gitlab-ci.yml'
variables:
PAL_BUILD_STRATEGY: 'docker'

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM rust:1
RUN apt-get update
RUN apt-get install -y protobuf-compiler
RUN cargo install --git https://github.com/ankitects/anki.git anki-sync-server
CMD [ "anki-sync-server" ]

74
k8s/deployment.yaml Normal file
View File

@ -0,0 +1,74 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: anki-storage
namespace: default
spec:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: anki-deployment
namespace: default
labels:
app: anki
spec:
selector:
matchLabels:
app: anki
template:
metadata:
labels:
app: anki
spec:
imagePullSecrets:
- name: paltiverse-docker
containers:
- name: anki
image: gitlab.palk.me:5050/paltiverse/palanki:$CI_COMMIT_SHA
ports:
- containerPort: 8080
resources:
limits:
cpu: 500m
requests:
cpu: 200m
env:
- name: SYNC_PORT
value: "8080"
- name: SYNC_BASE
value: "/data/sync"
- name: SYNC_USER1
valueFrom:
secretKeyRef:
key: user1
name: anki-users
volumeMounts:
- mountPath: "/data/sync"
name: anki-sync-base
volumes:
- name: anki-sync-base
persistentVolumeClaim:
claimName: anki-storage
---
apiVersion: v1
kind: Service
metadata:
name: anki-svc
namespace: default
spec:
type: NodePort
ports:
- targetPort: 8080
port: 8081
selector:
app: anki