feat: dockerfile and docker-compose

This commit is contained in:
GitBluub
2022-06-19 22:39:25 +02:00
parent 8ed33d2fe8
commit 039a53ef34
5 changed files with 58 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
FROM node:17
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npx prisma generate
RUN npm run build
CMD ["npm", "run", "start:prod"]
+7
View File
@@ -0,0 +1,7 @@
FROM node:17
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npx prisma generate
CMD [ "npm" , "run", "start:dev"]
+2 -1
View File
@@ -1,5 +1,6 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema generator client {
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
+23
View File
@@ -0,0 +1,23 @@
services:
back:
build:
context: ./back
dockerfile: Dockerfile.dev
privileged: true
ports:
- "8080:3000"
volumes:
- ./back:/app
depends_on:
- "db"
env_file:
- .env
db:
container_name: db
image: postgres:alpine3.14
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_NAME}
ports:
- "${POSTGRES_PORT}:5432"
+18
View File
@@ -0,0 +1,18 @@
services:
back:
build: ./back
ports:
- "8080:3000"
depends_on:
- "db"
env_file:
- .env
db:
container_name: db
image: postgres:alpine3.14
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_NAME}
ports:
- "5432:5432"