Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-.env-from-env - fixes #636 #637

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
CMD [ "npm", "start" ]
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: "3"
services:
kutt:
image: kutt/kutt
#build: .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, can be omitted. It's just for building local containers from local code

depends_on:
- postgres
- redis
Expand Down
23 changes: 23 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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_DOMAIN \
; do
if [ -n "${!param}" ] ; then
echo "$param=\"${!param}\"" >>.env
fi
done

echo "Running $@"
exec "$@"