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 adb3a4c commit 1963e4d
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 la directory per l'app e imposta i permessi
RUN mkdir -p /home/node/app && chown -R node:node /home/node/app

# 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 come utente root
COPY package*.json ./

# Cambia l'utente in node
USER node

# Installa le dipendenze
RUN npm install --unsafe-perm

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

# Comando di avvio dell'app
CMD [ "node", "app.js" ]

0 comments on commit 1963e4d

Please sign in to comment.