From c21b26b56d6a0b416f49b2c8d592e87d11380ca6 Mon Sep 17 00:00:00 2001 From: Folke Ashberg Date: Sat, 15 Oct 2022 20:51:19 +0200 Subject: [PATCH 1/4] create-.env-from-env --- Dockerfile | 7 +++++-- docker-compose.yml | 2 +- entrypoint.sh | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 096adf664..fd4a9cca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,15 @@ RUN npm install COPY . . # Give permission to run script -RUN chmod +x ./wait-for-it.sh +RUN chmod +x ./wait-for-it.sh ./entrypoint.sh # Build files RUN npm run build EXPOSE 3000 +# entrypoint +ENTRYPOINT [ "./entrypoint.sh" ] + # Running the app -CMD [ "npm", "start" ] \ No newline at end of file +CMD [ "npm", "start" ] diff --git a/docker-compose.yml b/docker-compose.yml index 1da056a18..20c2dcfb0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: kutt: - image: kutt/kutt + build: . depends_on: - postgres - redis diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 000000000..856ea4194 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "entrypoint.sh" +# creates .env file for next.config.js +for param in \ + CONTACT_EMAIL \ + SITE_NAME \ + DEFAULT_DOMAIN \ + RECAPTCHA_SITE_KEY \ + GOOGLE_ANALYTICS \ + REPORT_EMAIL \ + DISALLOW_ANONYMOUS_LINKS \ + DISALLOW_REGISTRATION \ + SENTRY_PUBLIC_DSN \ + DISALLOW_CUSTOMDOMAINS \ + ; do + if [ -n "${!param}" ] ; then + echo "$param=\"${!param}\"" >>.env + fi +done + +echo "Running $@" +exec "$@" \ No newline at end of file From af84233efb8ca15eb0387a606015b322ecc3d4b2 Mon Sep 17 00:00:00 2001 From: Folke Ashberg Date: Sun, 16 Oct 2022 11:35:20 +0200 Subject: [PATCH 2/4] undo docker-compose.yml change --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 20c2dcfb0..5ef8fa0f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,8 @@ version: "3" services: kutt: - build: . + image: kutt/kutt + #build: . depends_on: - postgres - redis From a4f0a1eada777e1e6aa5197d4d566bde4f86965e Mon Sep 17 00:00:00 2001 From: Folke Ashberg Date: Sun, 16 Oct 2022 12:16:43 +0200 Subject: [PATCH 3/4] adopt to current #638 --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 856ea4194..3fdf4dd9e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,7 +12,7 @@ for param in \ DISALLOW_ANONYMOUS_LINKS \ DISALLOW_REGISTRATION \ SENTRY_PUBLIC_DSN \ - DISALLOW_CUSTOMDOMAINS \ + DISALLOW_DOMAIN \ ; do if [ -n "${!param}" ] ; then echo "$param=\"${!param}\"" >>.env From 0cfecfccbbb43635f398747fd9295370a581d4b7 Mon Sep 17 00:00:00 2001 From: Folke Date: Tue, 29 Nov 2022 21:03:11 +0100 Subject: [PATCH 4/4] Update docker-compose.yml --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5ef8fa0f5..1da056a18 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,6 @@ version: "3" services: kutt: image: kutt/kutt - #build: . depends_on: - postgres - redis