-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
3 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |