diff --git a/collection/.env.local.template b/collection/.env.local.template index 569332b..5566c66 100644 --- a/collection/.env.local.template +++ b/collection/.env.local.template @@ -23,3 +23,6 @@ ROOT_USER_EMAIL="guilds.docsoc@imperial.ac.uk" # Replace "postgres:postgres" with ":" # 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= \ No newline at end of file diff --git a/collection/Dockerfile b/collection/Dockerfile index ef914dc..ccf1682 100644 --- a/collection/Dockerfile +++ b/collection/Dockerfile @@ -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 @@ -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"] diff --git a/collection/entry.sh b/collection/entry.sh new file mode 100755 index 0000000..b280dd9 --- /dev/null +++ b/collection/entry.sh @@ -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 \ No newline at end of file