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

feat: support for postgresql certificate for ssl connections #14

Merged
merged 3 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions collection/.env.local.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ ROOT_USER_EMAIL="[email protected]"
# Replace "postgres:postgres" with "<username>:<password>"
# And docsoc-tools-collection with the name of the database you are using
COLLECTION_DATABASE_URL="postgres://postgres:postgres@localhost:5432/docsoc-tools-collection"

# Optional PSQL certicate if the connection occurs over SSL
PG_CERT=
3 changes: 2 additions & 1 deletion collection/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ COPY --from=builder /build/collection/.next/standalone/common ./
COPY --from=builder /build/collection/.next/standalone/package.json ./
COPY --from=builder /build/collection/.next/standalone/node_modules ./node_modules
COPY --from=builder /build/collection/.next/static ./.next/static
COPY --from=builder /build/collection/entry.sh ./entry.sh
COPY --from=builder --chown=node:node /build/collection/prisma ./prisma


Expand All @@ -60,4 +61,4 @@ EXPOSE 3000
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry.
ENV NEXT_TELEMETRY_DISABLED=1
CMD ["dumb-init", "node", "server.js"]
CMD ["dumb-init", "./entry.sh"]
cybercoder-naj marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions collection/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/dumb-init /bin/sh

# This is to be used with the Docker Container only!
# The script loads the PSQL certificate and starts the server.

echo $PG_CERT > ./prisma/postgres.crt

node server.js