diff --git a/Dockerfile b/Dockerfile index 5f70f92..a84520e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,28 @@ FROM node:20-alpine +# Install build dependencies required by node-gyp +RUN apk add --no-cache python3 make g++ \ + && npm config set python /usr/bin/python3 + # Create working directory WORKDIR /opt/app -# Copy and install dependencies -COPY package.json . -COPY package-lock.json . -COPY babel.config.js . -COPY tsconfig.json . -COPY .env . -COPY src ./src +# Copy dependency files first (for layer caching) +COPY package*.json ./ +COPY babel.config.js tsconfig.json ./ +COPY .env ./ + +# Install dependencies RUN npm install +# Copy application source +COPY src ./src + # Build project RUN npm run build -# Expose application port +# Expose port EXPOSE 3000 # Start app -CMD [ "npm", "start"] +CMD ["npm", "start"]