Skip to content

Commit d3cc8e6

Browse files
committed
Try an init container
1 parent 2e11159 commit d3cc8e6

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.diploi/helm/app.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ spec:
3030
terminationGracePeriodSeconds: 10
3131
imagePullSecrets:
3232
- name: diploi-pull-secret
33+
initContainers:
34+
- name: fix-data-perms
35+
image: busybox
36+
command: ["sh", "-c", "chown -R 1000:1000 /data"]
37+
volumeMounts:
38+
- name: ghost-mount
39+
mountPath: /data
40+
securityContext:
41+
runAsUser: 0
3342
containers:
3443
- name: app
3544
image: {{ .Values.images.app }}

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ FROM ghost:alpine
66
COPY --chown=1000:1000 . /app
77
COPY --chown=1000:1000 ./.diploi/diploi-storage-adapter.js /var/lib/ghost/versions/$GHOST_VERSION/core/server/adapters/storage/
88

9-
# Initialize the data mount
10-
RUN mkdir /data
11-
RUN chown 1000:1000 /data
12-
139
ENV NODE_ENV=production
1410
ENV paths__contentPath=${FOLDER}
1511

Dockerfile.dev

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ FROM ghost:alpine
66
COPY --chown=1000:1000 . /app
77
COPY --chown=1000:1000 ./.diploi/diploi-storage-adapter.js /var/lib/ghost/versions/$GHOST_VERSION/core/server/adapters/storage/
88

9-
# Initialize the data mount
10-
RUN mkdir /data
11-
RUN chown 1000:1000 /data
12-
139
ENV NODE_ENV=development
1410
ENV paths__contentPath=${FOLDER}
1511

0 commit comments

Comments
 (0)