diff --git a/Dockerfile b/Dockerfile index e0aec3b..2389176 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file +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"] \ No newline at end of file