-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (35 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
43 lines (35 loc) · 1.15 KB
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
# Use the official Ubuntu base image
FROM ubuntu:22.04
# Set environment variables to avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies and Node.js
RUN apt update && \
apt install -y \
curl \
gnupg \
lsb-release \
software-properties-common && \
# Add NodeSource repository for Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt install -y nodejs && \
# Install gum
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://repo.charm.sh/apt/gpg.key | gpg --dearmor -o /etc/apt/keyrings/charm.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | tee /etc/apt/sources.list.d/charm.list && \
apt update && \
apt install -y gum && \
# Clean up
apt clean && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install Node.js dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Expose the port the app runs on
EXPOSE 3001
# Run the application
CMD ["node", "index.js"]