File size: 759 Bytes
fb724d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:18-bullseye-slim

# Install Git
RUN apt-get update && \
    apt-get install -y git

# Clone the repository into the /app directory
RUN --mount=type=secret,id=GITHUB_SSH_KEY,mode=0444,required=true \
    --mount=type=secret,id=GIT_LINK \
    git config --global credential.helper '!f() { echo "username=$(cat /run/secrets/GITHUB_SSH_KEY)\npassword=$(cat /run/secrets/GITHUB_SSH_KEY)"; }; f' && \
    git clone $(cat /run/secrets/GIT_LINK) /app
WORKDIR /app

# Install dependencies
RUN npm install
COPY Dockerfile greeting.md* .env* ./

# Copy files for build and build the app
RUN npm run build

# Expose the app's port
EXPOSE 7860

# Set the NODE_ENV environment variable to production
ENV NODE_ENV=production

# Start the app
CMD [ "npm", "start" ]