diff --git a/.dockerignore b/.dockerignore index 3237992dc..5bc266364 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ .dockerignore Dockerfile node_modules -puter \ No newline at end of file +/puter diff --git a/Dockerfile b/Dockerfile index 6bbb5dc93..b9c3e86b7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,12 @@ +# /!\ NOTICE /!\ + +# Many of the developers DO NOT USE the Dockerfile or image. +# While we do test new changes to Docker configuration, it's +# possible that future changes to the repo might break it. +# When changing this file, please try to make it as resiliant +# to such changes as possible; developers shouldn't need to +# worry about Docker unless the build/run process changes. + # Build stage FROM node:21-alpine AS build @@ -11,13 +20,13 @@ WORKDIR /app # Copy package.json and package-lock.json COPY package*.json ./ +# Copy the source files +COPY . . + # Install node modules RUN npm cache clean --force \ && npm ci -# Copy the rest of the source files -COPY . . - # Run the build command if necessary RUN npm run build @@ -39,7 +48,7 @@ WORKDIR /opt/puter/app # Copy built artifacts and necessary files from the build stage COPY --from=build /app/dist ./dist COPY --from=build /app/node_modules ./node_modules -COPY package*.json ./ +COPY . . # Set permissions RUN chown -R node:node /opt/puter/app @@ -50,4 +59,4 @@ EXPOSE 4100 HEALTHCHECK --interval=30s --timeout=3s \ CMD wget --no-verbose --tries=1 --spider http://puter.localhost:4100/test || exit 1 -CMD ["npm", "start"] \ No newline at end of file +CMD ["npm", "start"]