Can I exclude the main flarum/app directory from the mondedie/flarum:1.3.0 docker image?
I'm trying to migrate the files from my flarum to the ebs volume in aws, but when I try to make the mount point (deployment eks) as flarum/app, my pod doesn't start well. I tried in my docker image build instructions to remove the directory (flarum/app) and mount a flarum/app on ebs, but the flarum/app directory in my image doesn't go away.
I tried rm -rfv /flarum/app but it didn't work.
My dockerfile is:
FROM --platform=linux/arm64 mondedie/flarum:1.3.0
COPY ./app /tmp/app
RUN chown -R 991:991 /tmp
RUN chmod 777 /flarum/app
RUN rm -rfv /flarum/app
My deployment file is:
apiVersion: apps/v1
type: deployment
metadata:
name: flarum
namespace: flarum
specification:
replicas: 1
selector:
matching labels:
app.kubernetes.io/name: flarum selector
model:
metadata:
labels:
app.kubernetes.io/name: flarum selector
specification:
containers:
- name: flarum
image: ...../flarum: latest
ports:
- container port: 80
imagePullPolicy: Always
environment:
- name: DEBUG
value: "false"
- name: DB_HOST
value: "xxxx"
- name: DB_NAME
value: "xxxx"
- name: DB_USER
value: "flarum"
- name: DB_PASS
value: "xxxxxx"
- name: DB_PREF
value: "flarum_"
- name: DB_PORT
value: "xxxx"
- name: FORUM_URL
value: "https://xxxxxx"
- name: FLARUM_PORT
value: "xx"
volumeMounts:
- name: flarum
mountPath: /flarum/app
initContainers:
- name: move-data
image: xxxxx/flarum: latest
imagePullPolicy: Always
command: ["/bin/sh"]
args: ["-c", "cp -r /tmp/app/* /flarum/app; rm -Rf /tmp/app;"]
volumeMounts:
- name: flarum
mountPath: /flarum/app
volumes:
- name: flarum
persistentVolumeClaim:
ClaimName: ebs-claim-flarum
The error message when running kubectl apply is that I need to set the admin user, but what I think is happening is that the copy statement didn't work well because I can't set the flarum/app home directory in ebs because it already exists in the image flarum.
Can anyone help me ?