File size: 1,189 Bytes
22292b9
 
 
 
 
 
4b3e823
 
effdf6f
4b3e823
 
 
22292b9
 
 
 
359710b
 
 
 
 
 
22292b9
 
 
 
 
 
9eed1c8
22292b9
 
47cd18a
82ff841
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
# Use a Node.js image as the base
FROM node:14.18.0

# Set the working directory inside the container
WORKDIR /app

# Update apt sources to use the Debian archive
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \
    sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \
    sed -i '/stretch-updates/d' /etc/apt/sources.list && \
    echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \
    apt-get update && apt-get install -y git && apt-get clean

# Clone the repository
RUN git clone https://github.com/ztjhz/BetterChatGPT.git .

# Change ownership of the app directory to ensure proper file permissions
RUN chown -R node:node /app

# Switch to the non-root user for security and permission fixes
USER node

# Install dependencies using Yarn or npm
# Uncomment the one you prefer (default: Yarn)
# RUN npm install
RUN yarn install

# Expose the port the app runs on (adjust if necessary)
EXPOSE 5173

# Start the development server
CMD ["yarn", "dev"]
#CMD ["/home/appuser/.yarn/bin/serve", "-s", "dist", "-l", "3000"]