Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
manustars authored Oct 7, 2024
1 parent cfdde30 commit a57568f
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
FROM node:20-alpine
FROM node:12-alpine

# Crea una directory per l'app e imposta i permessi
RUN mkdir -p /home/node/app/node_modules

# Imposta la directory di lavoro
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
WORKDIR /home/node/app

# Copia i file di configurazione delle dipendenze
COPY package*.json ./

# Esegui npm install come root
RUN npm install

# Cambia l'utente per eseguire l'app
USER node

# Copia il resto dei file dell'app, mantenendo i permessi
RUN npm install
COPY --chown=node:node . .

# Comando per avviare l'app
CMD [ "node", "app.js" ]

0 comments on commit a57568f

Please sign in to comment.