Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions client/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -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;'"]
4 changes: 2 additions & 2 deletions server/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -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"]