Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb committed Jan 23, 2024
1 parent 1b085a9 commit 559c092
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dockerfile
.dockerignore
node_modules
dist
.env
.env.*
README.md
16 changes: 16 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:18-slim AS builder
WORKDIR /app
COPY . .
# Dependency for Prisma
RUN apt-get update -y && apt-get install -y openssl
RUN npm ci
RUN npm run build

FROM node:18-slim
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app ./
# Dependency for Prisma
RUN apt-get update -y && apt-get install -y openssl
EXPOSE 3000
CMD ["npm", "run", "start:prod"]
16 changes: 16 additions & 0 deletions backend/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"

services:
codepair-backend:
build:
context: ../
environment:
DATABASE_URL: "DATABASE_URL"
GITHUB_CLIENT_ID: "GITHUB_CLIENT_ID"
GITHUB_CLIENT_SECRET: "GITHUB_CLIENT_SECRET"
GITHUB_CLIENT_CALLBACK_URL: "<BACKEND_BASE_URL>/auth/login/github"
JWT_AUTH_SECRET: "JWT_AUTH_SECRET"
FRONTEND_BASE_URL: "FRONTEND_BASE_URL"
ports:
- "3000:3000"
restart: unless-stopped

0 comments on commit 559c092

Please sign in to comment.