Skip to content

Instantly share code, notes, and snippets.

@DylanDelobel
Created January 17, 2023 23:44
Show Gist options
  • Save DylanDelobel/fe7f0d2f321a7ed18762d786fe511e44 to your computer and use it in GitHub Desktop.
Save DylanDelobel/fe7f0d2f321a7ed18762d786fe511e44 to your computer and use it in GitHub Desktop.
prisma js discord docker
version: "3.9"
services:
postgres:
image: postgres:latest
container_name: postgres
hostname: postgres
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: brulerie
volumes:
- postgres-data:/var/lib/postgresql/data
restart: unless-stopped
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
depends_on:
- postgres
ports:
- "5555:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin-data:/var/lib/pgadmin
restart: unless-stopped
discord-bot-brulerie:
stdin_open: true
build:
context: .
dockerfile: Dockerfile
container_name: discord-bot-brulerie
depends_on:
- postgres
ports:
- "3000:3000"
restart: always
volumes:
postgres-data:
pgadmin-data:
FROM node:alpine
WORKDIR /app
# COPY package.json and package-lock.json files
COPY package*.json ./
# generated prisma files
COPY prisma ./prisma/
# COPY ENV variable
COPY .env.prod ./.env
# COPY tsconfig.json file
COPY tsconfig.json ./
# COPY
COPY src ./src/
RUN npm install
RUN npx prisma generate
RUN npm run build
# Run and expose the server on port 3000
EXPOSE 3000
# A command to start the server
CMD npm run start:dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment