-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
52 lines (38 loc) · 1.05 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
52
# Base image for frontend and backend
FROM node:20-alpine AS base
RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont \
openssl
ENV PUPPETEER_SKIP_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
# 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"]