Create Dockerfile
Browse files- Dockerfile +77 -0
Dockerfile
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Node.js image based on Debian Bullseye Slim as the base image
|
| 2 |
+
|
| 3 |
+
FROM node:18-bullseye-slim
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
# Update the package list and install git
|
| 8 |
+
|
| 9 |
+
RUN apt-get update && \
|
| 10 |
+
|
| 11 |
+
apt-get install -y git
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Clone the repository from the provided GitHub URL into the /app directory
|
| 16 |
+
|
| 17 |
+
RUN git clone https://github.com/cg-dot/oai-reverse-proxy.git /app
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# Set the working directory to /app
|
| 22 |
+
|
| 23 |
+
WORKDIR /app
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
# Change ownership of the /app directory to user with UID 1000 and group with GID 1000
|
| 28 |
+
|
| 29 |
+
RUN chown -R 1000:1000 /app
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
# Switch to the user with UID 1000
|
| 34 |
+
|
| 35 |
+
USER 1000
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
# Install npm dependencies
|
| 40 |
+
|
| 41 |
+
RUN npm install
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
# Copy the Dockerfile, greeting.md, and any .env files to the current working directory
|
| 46 |
+
|
| 47 |
+
COPY Dockerfile greeting.md* .env* ./
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
# Run the build script defined in package.json
|
| 52 |
+
|
| 53 |
+
RUN npm run build
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
# Expose port 7860 to the outside world
|
| 58 |
+
|
| 59 |
+
EXPOSE 7860
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
# Set environment variable NODE_ENV to production
|
| 64 |
+
|
| 65 |
+
ENV NODE_ENV=production
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
# Set Node.js options to limit the old space (heap) size
|
| 70 |
+
|
| 71 |
+
ENV NODE_OPTIONS="--max-old-space-size=12882"
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
# Define the command to start the application
|
| 76 |
+
|
| 77 |
+
CMD [ "npm", "start" ]
|