Replacing postgresql.conf in a docker container

I am pulling the postgres:12.0-alpine docker image to build my database. My intention is to replace the postgresql.conf file in the container to reflect the changes I want (changing data directory, modify backup options etc). I am trying with the following docker file

FROM postgres:12.0-alpine

# create the custom user 
RUN addgroup -S custom && adduser -S custom_admin -G custom

# create the appropriate directories 
ENV APP_HOME=/home/data 
ENV APP_SETTINGS=/var/lib/postgresql/data 

# copy 

# copy postgresql.conf 
COPY ./postgresql.conf $APP_HOME/postgresql.conf

RUN chmod +x /home/data/

# chown all the files to the app user 
RUN chown -R custom_admin:custom $APP_HOME 
RUN chown -R custom_admin:custom $APP_SETTINGS

# change to the app user 
USER custom_admin

# run 
ENTRYPOINT ["/home/data/"]

CMD ["custom_admin"]

my looks like


rm /var/lib/postgresql/data/postgresql.conf
cp ./postgresql.conf /var/lib/postgresql/data/postgresql.conf

echo "replaced .conf file"

exec "[email protected]"

But I get an exec error saying ‘custom_admin: not found on the ‘exec “[email protected]”‘ line. What am I missing here?

Source: StackOverflow