mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-18 13:34:14 +02:00
feat(config): add docker
This commit is contained in:
parent
c06d880f56
commit
a38db17468
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
||||
.idea
|
||||
dist
|
||||
node_modules
|
||||
tsconfig.tsbuildinfo
|
||||
npm-debug.log
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
FROM node:18-buster
|
||||
|
||||
WORKDIR /opt/app
|
||||
|
||||
COPY --chown=node:node package.json .
|
||||
COPY --chown=node:node package-lock.json .
|
||||
COPY --chown=node:node tsconfig.json .
|
||||
COPY --chown=node:node prisma ./prisma/
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
RUN chown node:node /opt/app/
|
||||
|
||||
USER node
|
||||
|
||||
CMD [ "npm", "run", "start:migrate"]
|
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@ -0,0 +1,24 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:14
|
||||
container_name: postgres
|
||||
restart: always
|
||||
ports:
|
||||
- 5432:5432
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
|
||||
node:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
depends_on:
|
||||
- postgres
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
postgres:
|
||||
name: arabot-db
|
@ -6,7 +6,8 @@
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"cleanBuild": "rm -rf ./dist && tsc",
|
||||
"start": "node dist/index.js"
|
||||
"start": "node dist/index.js",
|
||||
"start:migrate": "prisma migrate deploy && npm run start"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
x
Reference in New Issue
Block a user