-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 852 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 852 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Base image for frontend and backend
FROM node:20-alpine AS base
# Accept build-time arguments
ARG DATABASE_URL
ARG SENTRY_AUTH_TOKEN
# Set the working directory to /app for the frontend
WORKDIR /app
# Copy app directory contents to /app
COPY ./app/ ./
# Install dependencies for the frontend
RUN yarn install
# Make sure NODE_ENV is set to production
ENV NODE_ENV=production
# Build the frontend
RUN yarn build
# Set the working directory to /api for the backend
WORKDIR /api
# Copy api directory contents to /api
COPY ./api/ ./
# Install dependencies for the backend
RUN yarn install
# Build Prisma (assumes you have a Prisma setup)
RUN npx prisma generate
RUN npx prisma migrate deploy
# Expose the required port for the backend
EXPOSE 3000
# Ensure environment variables are injected at runtime (no .env embedded)
CMD ["yarn", "start"]