fix dockerfile
All checks were successful
Build and publish farmacia-bot images / Build and push client's image to Gitea's registry (push) Successful in 16s
Build and publish farmacia-bot images / deploy_ovh (push) Successful in 10s

This commit is contained in:
Giancarmine Salucci 2025-04-15 13:40:09 +02:00
parent dd7fe20233
commit 1df1078cf2

View File

@ -1,24 +1,15 @@
FROM node:23-alpine
# Switch to non-root user
WORKDIR /home/node
USER node
COPY --chown=node:node package*.json ./
# Install dependencies
RUN npm install
# Copy application files with correct ownership
COPY --chown=node:node main.js util.js worker.js ./
# Create logs directory with correct permissions
RUN mkdir -p app/logs && chown -R node:node app
WORKDIR /home/node/app
COPY --chown=node:node package*.json ./
RUN npm install
COPY --chown=node:node main.js util.js worker.js ./
# Expose logs directory as a volume
VOLUME ["/home/node/app/logs"]
# Use an environment variable for thread count (default to 0 to use auto)
ENV THREAD_COUNT=0
# Run the application - using JSON array format
CMD ["sh", "-c", "node main.js ${THREAD_COUNT}"]