Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Apr 15, 2024
1 parent e4f2c4a commit 9bb221a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.dockerignore
Dockerfile
node_modules
puter
/puter
19 changes: 14 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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"]
CMD ["npm", "start"]

0 comments on commit 9bb221a

Please sign in to comment.