Spaces:
Running
Running
File size: 890 Bytes
014ba0a c64f8c4 3227eb4 014ba0a 3227eb4 014ba0a 3227eb4 19ebf44 014ba0a 141259e 1788a23 3227eb4 1788a23 18652c3 212cb3a d471da2 9ea5a36 014ba0a 1788a23 014ba0a d471da2 |
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 |
# Use the official Node.js v18 image as the base image
FROM node:18
RUN if id -u 1000 &> /dev/null; then \
uid=$(shuf -i 1001-65535 -n 1) \
&& useradd -m -u $uid user; \
else \
useradd -m -u 1000 user; \
fi
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY --chown=user package*.json ./
# Install dependencies
RUN npm install
# Copy the entire application code to the working directory
COPY --chown=user . .
# remove .env file if it exists
RUN rm -f -- .env
# Build the TypeScript code
#RUN npm run build
USER user
# Set the PORT environment variable
ENV PORT=7860
ARG JWT_SECRET
ARG JWT_EXPIRES_IN
ARG DB_URI
ARG MODELS_SERVER_URL
# Expose the port on which your application will run
EXPOSE $PORT
# Command to run the application
CMD ["npm", "run", "start:dev"]
|