Spaces:
Sleeping
Sleeping
# Use an official Node.js runtime as a parent image | |
FROM node:18-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy package.json and package-lock.json to the working directory | |
COPY package*.json ./ | |
# Install app dependencies | |
# Using --production flag to install only production dependencies | |
# Playwright needs special handling to download browsers | |
# We need to install dependencies first to make sure Playwright downloads its browsers. | |
RUN npm install --production | |
# Copy the rest of the application source code to the working directory | |
COPY . . | |
# Grant execute permission to the proxy server binary for the root user | |
RUN chmod +x /app/src/proxy/chrome_proxy_server_linux_amd64 | |
# Change ownership of the app directory to the node user | |
RUN chown -R node:node /app | |
# Switch to a non-root user for security | |
USER node | |
# Make port 7860 available to the world outside this container | |
EXPOSE 7860 | |
# Define the command to run the app | |
CMD ["npm", "start"] |