-
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 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" ] |