Skip to content

Commit bba55db

Browse files
authored
Merge pull request #89 from t-ho/fix/update-production-dockerfiles-to-yarn
fix: update production Dockerfiles to use yarn instead of npm
2 parents 9004ccc + ececba9 commit bba55db

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

client/Dockerfile.prod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM node:lts-buster as builder
1+
FROM node:lts-buster AS builder
22
WORKDIR /mern-stack/client
33
COPY ./client ./
4-
RUN npm ci
4+
RUN yarn install --frozen-lockfile
55
ARG facebook_app_id
66
ENV REACT_APP_FACEBOOK_APP_ID=${facebook_app_id}
77
ARG google_client_id
88
ENV REACT_APP_GOOGLE_CLIENT_ID=${google_client_id}
99
ARG version
1010
ENV REACT_APP_VERSION=${version}
11-
RUN npm run build
11+
RUN yarn build
1212

1313
FROM nginx:stable-alpine
1414
COPY --from=builder /mern-stack/client/build /usr/share/nginx/html
1515
COPY ./client/nginx.service.conf.prod /etc/nginx/conf.d/default.conf
1616
EXPOSE 3000
17-
CMD ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && nginx -g "daemon off;"
17+
CMD ["sh", "-c", "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && nginx -g 'daemon off;'"]

server/Dockerfile.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ FROM node:lts-buster
22
WORKDIR /mern-stack/server
33
COPY ./server ./
44
# NOTE: We don't copy the .env file. Please specify env vars at runtime
5-
RUN npm ci
6-
CMD ["npm", "run", "prod"]
5+
RUN yarn install --frozen-lockfile
6+
CMD ["yarn", "prod"]

0 commit comments

Comments
 (0)