diff --git a/client/Dockerfile.prod b/client/Dockerfile.prod index 81c62af..aea0c5b 100644 --- a/client/Dockerfile.prod +++ b/client/Dockerfile.prod @@ -1,17 +1,17 @@ -FROM node:lts-buster as builder +FROM node:lts-buster AS builder WORKDIR /mern-stack/client COPY ./client ./ -RUN npm ci +RUN yarn install --frozen-lockfile ARG facebook_app_id ENV REACT_APP_FACEBOOK_APP_ID=${facebook_app_id} ARG google_client_id ENV REACT_APP_GOOGLE_CLIENT_ID=${google_client_id} ARG version ENV REACT_APP_VERSION=${version} -RUN npm run build +RUN yarn build FROM nginx:stable-alpine COPY --from=builder /mern-stack/client/build /usr/share/nginx/html COPY ./client/nginx.service.conf.prod /etc/nginx/conf.d/default.conf EXPOSE 3000 -CMD ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && nginx -g "daemon off;" +CMD ["sh", "-c", "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && nginx -g 'daemon off;'"] diff --git a/server/Dockerfile.prod b/server/Dockerfile.prod index c9a435b..5a2e554 100644 --- a/server/Dockerfile.prod +++ b/server/Dockerfile.prod @@ -2,5 +2,5 @@ FROM node:lts-buster WORKDIR /mern-stack/server COPY ./server ./ # NOTE: We don't copy the .env file. Please specify env vars at runtime -RUN npm ci -CMD ["npm", "run", "prod"] +RUN yarn install --frozen-lockfile +CMD ["yarn", "prod"]