File size: 1,130 Bytes
f86c0eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Use the official Node.js image based on Debian Bullseye Slim as the base image

FROM node:18-bullseye-slim



# Update the package list and install git

RUN apt-get update && \

apt-get install -y git



# Clone the repository from the provided GitHub URL into the /app directory

RUN git clone https://github.com/cg-dot/oai-reverse-proxy.git /app



# Set the working directory to /app

WORKDIR /app



# Change ownership of the /app directory to user with UID 1000 and group with GID 1000

RUN chown -R 1000:1000 /app



# Switch to the user with UID 1000

USER 1000



# Install npm dependencies

RUN npm install



# Copy the Dockerfile, greeting.md, and any .env files to the current working directory

COPY Dockerfile greeting.md* .env* ./



# Run the build script defined in package.json

RUN npm run build



# Expose port 7860 to the outside world

EXPOSE 7860



# Set environment variable NODE_ENV to production

ENV NODE_ENV=production



# Set Node.js options to limit the old space (heap) size

ENV NODE_OPTIONS="--max-old-space-size=12882"



# Define the command to start the application

CMD [ "npm", "start" ]