feat(ops): kubernetes deployment
This commit is contained in:
38
microblogpub-dev.yaml
Normal file
38
microblogpub-dev.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: microblogpub-compile-css
|
||||
namespace: microblogpub
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: css-compiler
|
||||
image: python:3.11-slim
|
||||
command: ["/bin/bash", "-c"]
|
||||
args:
|
||||
- |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends curl build-essential gcc libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev libxslt-dev gcc libjpeg-dev zlib1g-dev libwebp-dev make git
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
export PATH="/root/.local/bin:$PATH"
|
||||
cd /app
|
||||
git clone https://git.sr.ht/~tsileo/microblog.pub .
|
||||
poetry install
|
||||
poetry run inv compile-scss
|
||||
cp -r app/static/css/* /compiled-css/
|
||||
volumeMounts:
|
||||
- name: app-data
|
||||
mountPath: /app/data
|
||||
- name: compiled-css
|
||||
mountPath: /compiled-css
|
||||
workingDir: /app
|
||||
volumes:
|
||||
- name: app-data
|
||||
persistentVolumeClaim:
|
||||
claimName: microblogpub-data
|
||||
- name: compiled-css
|
||||
persistentVolumeClaim:
|
||||
claimName: microblogpub-css
|
||||
restartPolicy: Never
|
||||
|
Reference in New Issue
Block a user