Skip to content

Commit

Permalink
Copy node_modules/.prisma to frontend docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
needs committed Dec 9, 2024
1 parent d76ff83 commit 7e1bde1
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ RUN chown -R frontend:frontend .
RUN npm --omit=dev -f install
RUN npm install sharp

COPY libs/prisma/prisma/schema.prisma prisma/schema.prisma
COPY libs/prisma/prisma/sql prisma/sql
RUN npx prisma generate
COPY node_modules/.prisma node_modules/.prisma

# COPY libs/prisma/prisma/schema.prisma prisma/schema.prisma
# COPY libs/prisma/prisma/sql prisma/sql
# RUN npx prisma generate --sql

CMD [ "npm", "start" ]
80 changes: 80 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: '3.8'

services:
postgres:
image: postgres:latest
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: teerank
ports:
- "5432:5432"
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data

redis:
image: redis:latest
ports:
- "6379:6379"
restart: always
volumes:
- redis_data:/data

frontend:
build:
context: .
dockerfile: apps/frontend/Dockerfile
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/teerank
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- postgres
- redis
restart: always

worker:
build:
context: .
dockerfile: apps/worker/Dockerfile
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/teerank
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- postgres
- redis
restart: always

scheduler:
build:
context: .
dockerfile: apps/scheduler/Dockerfile
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/teerank
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- postgres
- redis
restart: always

bullboard:
image: venatum/bull-board
restart: always
ports:
- "3002:3000"
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_USE_TLS: 'false'
BULL_PREFIX: bull
depends_on:
- redis

volumes:
postgres_data:
redis_data:
1 change: 1 addition & 0 deletions libs/prisma/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["typedSql", "postgresqlExtensions"]
binaryTargets = env("PRISMA_BINARY_TARGETS")
}

datasource db {
Expand Down

0 comments on commit 7e1bde1

Please sign in to comment.