Skip to content

Commit

Permalink
improve api dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Feb 11, 2025
1 parent 1c7c35d commit 8ace116
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion indexers/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
FROM node:18-alpine

# Switch to root user to install packages
USER root

# Install Python and build tools
RUN apk update && apk add --no-cache python3 make g++

# Switch back to the default user
USER node

# Create app directory
WORKDIR /app

COPY package*.json ./
# Copy the package.json file
COPY package.json ./

# Install dependencies
RUN yarn install

# Bundle app source
COPY . .

# Change ownership of the directory to the node user
USER root
RUN chown -R node:node /app

# Switch back to the default user
USER node

# Install dependencies
RUN yarn install

RUN yarn build

EXPOSE 3000
Expand Down

0 comments on commit 8ace116

Please sign in to comment.