Created
May 18, 2025 19:24
-
-
Save mikesparr/354768c3d86a448d63b94770543eb91d to your computer and use it in GitHub Desktop.
Inline Dockerfile entrypoint.sh creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a script to load environment variables from mounted secrets | |
RUN echo '#!/bin/sh' > /app/entrypoint.sh && \ | |
echo 'if [ -d "/secrets" ] && [ -f "/secrets/.env" ]; then' >> /app/entrypoint.sh && \ | |
echo ' cp /secrets/.env /app/.env' >> /app/entrypoint.sh && \ | |
echo ' echo "Loaded environment from mounted secret"' >> /app/entrypoint.sh && \ | |
echo 'fi' >> /app/entrypoint.sh && \ | |
echo 'exec node src/server.js' >> /app/entrypoint.sh && \ | |
chmod +x /app/entrypoint.sh && \ | |
chown nodeapp:nodeapp /app/entrypoint.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment