Random secret when run, not when build

This commit is contained in:
KGrzeg 2023-03-03 16:06:16 +01:00
parent 697836579b
commit cd50ab17b3
2 changed files with 14 additions and 4 deletions

View file

@ -27,8 +27,7 @@ COPY server/package*.json ./
RUN npm install --quite RUN npm install --quite
COPY server . COPY server .
RUN mkdir -p storage COPY ./run.sh .
RUN cp .env.example .env
RUN sed -i "s#HVuwh1dmaFhg4q1fef7xI4D6UeV7ImGK6NTp7i9eH6qiyJ9kxsvqPu29JXnhNGQY#$(head -c 12 /dev/random | base64)#" .env CMD ./run.sh
CMD ["npm", "run", "start"]

11
run.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
mkdir -p storage
if [ ! -f ".env" ]; then
cp .env.example .env
sed -i "s#HVuwh1dmaFhg4q1fef7xI4D6UeV7ImGK6NTp7i9eH6qiyJ9kxsvqPu29JXnhNGQY#$(head -c 12 /dev/random | base64)#" .env
fi
npm run start