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