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 all 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" ]
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 "$@"