docker deployment

This commit is contained in:
leca 2024-10-28 19:35:35 +03:00
parent 0e9a7f0856
commit f2945fc92d
5 changed files with 32 additions and 3 deletions

7
Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM node:22-bullseye
COPY . .
RUN npm i
EXPOSE 3000
ENTRYPOINT ["node", "./src/index.js"]

View File

@ -1,2 +1,8 @@
# bsfe_server
## Deployment
1. Edit ``config.json`` to your needs
2. Edit ``docker-compose.yml`` (insert changed database credentials from ``config.json``)
3. First-time: ``docker-compose up --build``
4. Then just: ``docker-compose up -d``

View File

@ -2,7 +2,7 @@
"debug": true,
"port": "8081",
"dbuser": "bsfe",
"dbhost": "localhost",
"dbhost": "database",
"dbport": "5432",
"dbpassword": "Ch@NgEME!",
"dbname": "bsfe",

18
docker-compose.yml Normal file
View File

@ -0,0 +1,18 @@
services:
bsfe:
build: .
ports:
- 8012:3000
depends_on:
- database
database:
image: 'postgres:15'
# ports:
# - 5432:5432
environment:
POSTGRES_USER: bsfe
POSTGRES_PASSWORD: Ch@NgEME!
POSTGRES_DB: bsfe

View File

@ -72,8 +72,6 @@ class AbstractProductController {
}
}
}
// async updateImage(req, res) {}
};
export default new AbstractProductController();