dockerfile update

master
Tudor Stanciu 2020-04-14 23:04:58 +03:00
parent 9a67a13312
commit 93a8f626bc
1 changed files with 15 additions and 12 deletions

View File

@ -19,25 +19,28 @@ RUN npm run build
# production environment
FROM node:12
COPY --from=builder /app/build ./build
COPY --from=builder /app/tools/mockData.js ./build/api/
COPY --from=builder /app/tools/createMockDb.js ./build/api/
COPY --from=builder /app/tools/apiServer.js ./build/api/
#RUN printf '\nAm copiat fisierele din build in imaginea finala!\n\n'
#RUN echo '\nRezultat:\n'
#RUN ls
#RUN printf '\nM-am mutat in directorul build!\n\n'
#RUN echo '\nRezultat:\n'
#RUN ls
#install static server
#install static server || Alternativ se poate utiliza si http-server
RUN npm install -g serve
#RUN printf '\nAm rulat npm install in imaginea finala!\n\n'
#RUN echo '\nRezultat:\n'
WORKDIR /build
RUN npm install json-server --save-prod
RUN printf '\n- Am instalat json-server!\n\n'
#RUN ls
EXPOSE 80
#CMD ["npm", "run", "start:prod"]
WORKDIR /
# Comenzile urmatoare sunt similare:
#CMD ["sh", "-c", "serve -s build -p 80"]
CMD ["serve", "-s", "build", "-p", "80"]
EXPOSE 80
#CMD ["sh", "-c", "node build/api/createMockDb.js && node build/api/apiServer.js && serve -s build -p 80"]
#CMD ["serve", "-s", "build", "-p", "80"]
#CMD ["sh", "-c", "node build/api/createMockDb.js && node build/api/apiServer.js", "serve", "-s", "build", "-p", "80"]