Skip to content

Commit

Permalink
Merge pull request #14 from icdocsoc/feat/support-postgres-crt
Browse files Browse the repository at this point in the history
feat: support for postgresql certificate for ssl connections
  • Loading branch information
cybercoder-naj authored Oct 20, 2024
2 parents 59e8b5a + 1ca33ec commit f6660e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
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 ["./entry.sh"]
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

0 comments on commit f6660e7

Please sign in to comment.