Skip to content

Commit c69b244

Browse files
committed
place generated environment variables in .env
1 parent d0f287a commit c69b244

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

other/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ RUN --mount=type=secret,id=SENTRY_AUTH_TOKEN \
5454
# Finally, build the production image with minimal footprint
5555
FROM base
5656

57+
# Generate random value and save it to .env file which will be loaded by dotenv
58+
RUN INTERNAL_COMMAND_TOKEN=$(openssl rand -hex 32) && \
59+
echo "INTERNAL_COMMAND_TOKEN=$INTERNAL_COMMAND_TOKEN" > .env
60+
5761
ENV FLY="true"
5862
ENV LITEFS_DIR="/litefs/data"
5963
ENV DATABASE_FILENAME="sqlite.db"
@@ -67,10 +71,6 @@ ENV NODE_ENV="production"
6771
# For WAL support: https://github.com/prisma/prisma-engines/issues/4675#issuecomment-1914383246
6872
ENV PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK = "1"
6973

70-
# Generate random value and set it as environment variable
71-
RUN INTERNAL_COMMAND_TOKEN=$(openssl rand -hex 32) && \
72-
echo "INTERNAL_COMMAND_TOKEN=$INTERNAL_COMMAND_TOKEN" >> /etc/environment
73-
7474
# add shortcut for connecting to database CLI
7575
RUN echo "#!/bin/sh\nset -x\nsqlite3 \$DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli
7676

0 commit comments

Comments
 (0)