Skip to content

Commit 81848f6

Browse files
committed
fix: resolve runtime module resolution and build configuration issues
- Update Dockerfile CMD to use 'dist/src/index.js' to match TypeScript output structure without rootDir constraint - Update docker-compose.yml command to use correct compiled path - Fix prisma.config.ts to use process.env.DATABASE_URL ?? '' instead of env() to avoid build-time failures when DATABASE_URL is not set - Add 'declaration: true' to tsconfig.json for proper type definitions - All API endpoints now pass e2e tests: POST /user, POST /post, GET /feed, PUT /publish/:id, GET /post/:id, DELETE /post/:id - Validation and error handling confirmed working (400, 404, 500 responses)
1 parent a6dd5cb commit 81848f6

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

deployment-platforms/rest-express-docker-aws-ec2/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ USER appuser
3232

3333
EXPOSE 3000
3434

35-
CMD ["node", "dist/index.js"]
35+
CMD ["node", "dist/src/index.js"]

deployment-platforms/rest-express-docker-aws-ec2/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
postgres:
1010
condition: service_healthy
1111
command: >
12-
sh -c "npx prisma migrate deploy && node dist/index.js"
12+
sh -c "npx prisma migrate deploy && node dist/src/index.js"
1313
1414
postgres:
1515
image: postgres:16-alpine
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineConfig, env } from 'prisma/config'
1+
import { defineConfig } from 'prisma/config'
22
import 'dotenv/config'
33

44
export default defineConfig({
@@ -7,6 +7,6 @@ export default defineConfig({
77
path: 'prisma/migrations',
88
},
99
datasource: {
10-
url: env('DATABASE_URL'),
10+
url: process.env.DATABASE_URL ?? '',
1111
},
1212
})

deployment-platforms/rest-express-docker-aws-ec2/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"module": "CommonJS",
99
"moduleResolution": "node",
1010
"resolveJsonModule": true,
11-
"skipLibCheck": true
11+
"skipLibCheck": true,
12+
"declaration": true
1213
},
1314
"include": ["src"]
1415
}

0 commit comments

Comments
 (0)