moahmedwafy commited on
Commit
1788a23
·
1 Parent(s): f6957f9

update: docker file

Browse files
Files changed (2) hide show
  1. Dockerfile +9 -3
  2. package.json +2 -2
Dockerfile CHANGED
@@ -13,11 +13,17 @@ RUN npm install
13
  # Copy the entire application code to the working directory
14
  COPY . .
15
 
 
 
 
16
  # Build the TypeScript code
17
- # RUN npm run build
 
 
 
18
 
19
  # Expose the port on which your application will run
20
- EXPOSE 4000
21
 
22
  # Command to run the application
23
- CMD ["npm", "start:dev"]
 
13
  # Copy the entire application code to the working directory
14
  COPY . .
15
 
16
+ # remove .env file
17
+ RUN rm .env
18
+
19
  # Build the TypeScript code
20
+ RUN npm run build
21
+
22
+ # Set the PORT environment variable
23
+ ENV PORT=3000
24
 
25
  # Expose the port on which your application will run
26
+ EXPOSE $PORT
27
 
28
  # Command to run the application
29
+ CMD ["node", "dist/index.js"]
package.json CHANGED
@@ -4,9 +4,9 @@
4
  "description": "",
5
  "main": "dist/index.js",
6
  "scripts": {
7
- "start": "rimraf dist && tsc && tsc-alias && node dist/index.js",
8
  "start:dev": "ts-node-dev --files -r tsconfig-paths/register src/index.ts",
9
- "build": "tsc",
10
  "lint": "eslint . --ext .ts"
11
  },
12
  "author": "",
 
4
  "description": "",
5
  "main": "dist/index.js",
6
  "scripts": {
7
+ "start": "build && node dist/index.js",
8
  "start:dev": "ts-node-dev --files -r tsconfig-paths/register src/index.ts",
9
+ "build": "rimraf dist && tsc && tsc-alias",
10
  "lint": "eslint . --ext .ts"
11
  },
12
  "author": "",