File size: 740 Bytes
174b0d4
1bc149f
 
 
 
 
 
 
 
174b0d4
 
 
1bc149f
 
 
 
 
 
174b0d4
 
 
 
 
 
 
c3ff46d
1bc149f
174b0d4
 
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
# Use the official Node.js LTS version as the base image
FROM node:lts

# Set the working directory
WORKDIR /usr/src/app

# Copy package.json and package-lock.json first to leverage Docker cache
COPY package*.json ./

# Install Angular CLI globally
RUN npm install -g @angular/cli

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Change ownership of the app directory to a non-root user (node)
RUN chown -R node:node /usr/src/app

# Switch to a non-root user for security
USER node

# Expose the port your application will run on
EXPOSE 7860

# Set the entry point for the container
ENTRYPOINT ["bash", "-c", "ng serve --host 0.0.0.0 --port 7860 --configuration=production --disable-host-check"]