Skip to content

Commit 535e78f

Browse files
added script automatic run to docker
1 parent 2e1d95b commit 535e78f

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ services:
1919
dockerfile: ./docker/api.Containerfile
2020
# https://docs.docker.com/reference/compose-file/build/#target
2121
target: production
22+
23+
entrypoint: ["/bin/sh", "-c", "replaceJwt.sh"]
2224
# https://docs.docker.com/reference/compose-file/services/#depends_on
2325
depends_on:
2426
minio:
@@ -52,7 +54,7 @@ services:
5254
- API_IS_GRAPHIQL=${API_IS_GRAPHIQL:?error}
5355
- API_IS_PINO_PRETTY=${API_IS_PINO_PRETTY:?error}
5456
- API_JWT_EXPIRES_IN=${API_JWT_EXPIRES_IN:?error}
55-
- API_JWT_SECRET=${REPLACE_WITH_RANDOM_JWT_TOKEN:?error}
57+
- API_JWT_SECRET=${API_JWT_SECRET:?error}
5658
- API_LOG_LEVEL=${API_LOG_LEVEL:?error}
5759
- API_MINIO_ACCESS_KEY=${API_MINIO_ACCESS_KEY:?error}
5860
- API_MINIO_END_POINT=${API_MINIO_END_POINT:?error}

envFiles/.env.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ API_IS_APPLY_DRIZZLE_MIGRATIONS=true
2020
API_IS_GRAPHIQL=false
2121
API_IS_PINO_PRETTY=false
2222
API_JWT_EXPIRES_IN=2592000000
23-
API_JWT_SECRET=b4896453be722d5ca94058a73f52b31c75980b485fa6d74d91f417a8059d8731
23+
API_JWT_SECRET=REPLACE_WITH_RANDOM_JWT_TOKEN
2424
API_LOG_LEVEL=info
2525
API_MINIO_ACCESS_KEY=talawa
2626
API_MINIO_END_POINT=minio

envFiles/.env.deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ API_IS_APPLY_DRIZZLE_MIGRATIONS=true
3030
API_IS_GRAPHIQL=false
3131
API_IS_PINO_PRETTY=false
3232
API_JWT_EXPIRES_IN=2592000000
33-
API_JWT_SECRET=dd06f326a810d9c7dd67b1428a4caef558d9e730d25e5440945f82948a56d96cd6f972222768cd2d77c28ad833f4a4a475a9828f87ac0ac3ec94df276fe24736
33+
API_JWT_SECRET=REPLACE_WITH_RANDOM_JWT_TOKEN
3434
API_LOG_LEVEL=info
3535
API_MINIO_ACCESS_KEY=talawa
3636
API_MINIO_END_POINT=minio

envFiles/.env.devcontainer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ API_IS_APPLY_DRIZZLE_MIGRATIONS=true
2222
API_IS_GRAPHIQL=true
2323
API_IS_PINO_PRETTY=true
2424
API_JWT_EXPIRES_IN=2592000000
25-
API_JWT_SECRET=b4896453be722d5ca94058a73f52b31c75980b485fa6d74d91f417a8059d8731
25+
API_JWT_SECRET=REPLACE_WITH_RANDOM_JWT_TOKEN
2626
API_LOG_LEVEL=debug
2727
API_MINIO_ACCESS_KEY=talawa
2828
API_MINIO_END_POINT=minio

envFiles/.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ API_IS_APPLY_DRIZZLE_MIGRATIONS=true
2020
API_IS_GRAPHIQL=false
2121
API_IS_PINO_PRETTY=false
2222
API_JWT_EXPIRES_IN=2592000000
23-
API_JWT_SECRET=
23+
API_JWT_SECRET=REPLACE_WITH_RANDOM_JWT_TOKEN
2424
API_LOG_LEVEL=info
2525
API_MINIO_ACCESS_KEY=talawa
2626
API_MINIO_END_POINT=minio

replaceJwt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Define the path to the compose file
4-
COMPOSE_FILE="./compose.yaml"
4+
COMPOSE_FILE="./.env"
55

66
# Generate a random JWT-like token (modify this logic if needed)
77
RANDOM_TOKEN=$(openssl rand -base64 32 | tr -d '=+/')

0 commit comments

Comments
 (0)