Skip to content

Commit 4d1a020

Browse files
Debugging why container isn't starting nestjs.
1 parent e6953fb commit 4d1a020

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

docker-compose.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,19 @@ services:
3434
environment:
3535
# Use docker network alias for Redis
3636
QUEUE_REDIS_HOST: redis
37+
# Redis port
38+
QUEUE_REDIS_PORT: 6379
3739
# Override application Redis servers config to use redis container
3840
REDIS_SERVERS: '{"AUTH":{"host":"redis","port":6379,"password":"","tls":false},"CACHE":{"host":"redis","port":6379,"password":"","tls":false}}'
3941
ports:
4042
- "4000:4000"
4143
depends_on:
4244
- db
4345
- redis
44-
entrypoint:
45-
- /bin/sh
46-
- -c
47-
- |
48-
echo "==== ENVIRONMENT VARIABLES ===="
49-
env
50-
echo "==== REDIS_SERVERS ===="
51-
echo "$REDIS_SERVERS"
52-
./docker-entrypoint.sh
53-
command: ["pnpm", "start"]
5446
networks:
5547
- codebuilder-net
48+
# Override default command to run the compiled production bundle
49+
command: ["pnpm", "start:prod"]
5650

5751

5852

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ echo -e "${BLUE}🚀 Starting NestJS application...${NC}"
4949
# ensuring it becomes the main process (PID 1) and receives signals correctly.
5050
exec "$@"
5151

52-
echo -e "${RED}🚀 NestJS Application Process Exited...${NC}"
52+
echo -e "${RED}🚀 NestJS Application Process Exited...${NC} $@"

src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ async function bootstrap(): Promise<void> {
164164
const port = Number.parseInt(String(portEnv), 10);
165165
console.log(`🛫 CodeBuilder API app taking off listening on http://localhost:${port}`);
166166

167-
168167
if (Number.isNaN(port)) {
169168
throw new Error(`PORT environment variable is not a valid number: "${portEnv}"`);
170169
}

0 commit comments

Comments
 (0)