-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (27 loc) · 849 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
38
39
# Use Ubuntu as the base image
FROM ubuntu:latest
# Install essential dependencies
RUN apt-get update && \
apt-get install -y curl gnupg && \
rm -rf /var/lib/apt/lists/*
# Install Node.js version 18.18.2
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get update && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# RUN echo "172.17.0.1 host.docker.internal" | tee -a /etc/hosts
# Build TypeScript
RUN npm run build
# Expose the port the app runs on
EXPOSE 3000
RUN npx prisma generate
# Command to run the application
CMD ["npm", "start"]