fix dockerfile in backend
This commit is contained in:
13
README.md
13
README.md
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# BackEnd
|
# BackEnd
|
||||||
## Backend init
|
### init
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 1. Set up PostgreSQL and fill in .env
|
# 1. Set up PostgreSQL and fill in .env
|
||||||
@@ -17,7 +17,7 @@ npm run seed:admin
|
|||||||
npm run seed:posts
|
npm run seed:posts
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compile and run Backend
|
### Compile and run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# development
|
# development
|
||||||
@@ -30,7 +30,7 @@ $ npm run start:dev
|
|||||||
$ npm run start:prod
|
$ npm run start:prod
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run tests in Backend
|
### Run tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# unit tests
|
# unit tests
|
||||||
@@ -51,4 +51,11 @@ $ npm run dev
|
|||||||
# build,deploy
|
# build,deploy
|
||||||
$ npm run build
|
$ npm run build
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
# Deploy
|
||||||
|
```
|
||||||
|
docker compose down --volumes
|
||||||
|
docker compose build --no-cache
|
||||||
|
docker compose up --force-recreate
|
||||||
```
|
```
|
||||||
@@ -10,5 +10,5 @@ WORKDIR /app
|
|||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci --omit=dev
|
RUN npm ci --omit=dev
|
||||||
COPY --from=base /app/dist ./dist
|
COPY --from=base /app/dist ./dist
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
CMD ["node", "dist/main.js"]
|
CMD ["node", "dist/src/main.js"]
|
||||||
@@ -22,7 +22,5 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"include": ["src/**/*", "scripts/**/*"],
|
|
||||||
"exclude": ["node_modules", "dist", "test"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user