-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (26 loc) · 802 Bytes
/
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
# Use the official Node.js image as the base image
FROM node:19-alpine
ARG NODE_ENV
ENV NODE_ENV=$NODE_ENV
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
RUN mv .env.docker .env \
&& sed -ie 's/postgresql/sqlite/g' prisma/schema.prisma \
&& sed -ie 's/mysql/sqlite/g' prisma/schema.prisma \
&& sed -ie 's/@db.Text//' prisma/schema.prisma
# Expose the port the app will run on
EXPOSE 3000
# Add Prisma and generate Prisma client
RUN npx prisma generate \
&& npx prisma migrate dev --name init \
&& npx prisma db push
# Build the Next.js app
RUN npm run build
# Start the application
CMD ["npm", "start"]