Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 90efd64

Browse files
authored
replace npm w/ yarn due to failure to install packages on alpine (#284)
* replace npm w/ yarn due to failure to install packages on alpine * add circle-ci * Change checksum based on yarn.lock instead of package.json * Update docker-entrypoint.sh
1 parent c7364a4 commit 90efd64

File tree

4 files changed

+5493
-11
lines changed

4 files changed

+5493
-11
lines changed

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
steps:
1111
- checkout
1212
- restore_cache:
13-
key: dependency-cache-{{ checksum "package.json" }}
13+
key: dependency-cache-{{ checksum "yarn.lock" }}
1414
- run:
1515
name: Install Dependencies
16-
command: npm install
16+
command: yarn
1717
- save_cache:
18-
key: dependency-cache-{{ checksum "package.json" }}
18+
key: dependency-cache-{{ checksum "yarn.lock" }}
1919
paths:
2020
- node_modules
2121
- run:
2222
name: Tests
23-
command: npm run test
23+
command: yarn test
2424
deploy:
2525
working_directory: ~/cp-users-service
2626
docker:

Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
FROM node:8-alpine
22
MAINTAINER butlerx <[email protected]>
33
ENV NODE_ENV=production
4-
ARG DEP_VERSION=latest
54
RUN apk add --update git build-base python postgresql-client && \
65
mkdir -p /usr/src/app
76
WORKDIR /usr/src/app
87
COPY . /usr/src/app/
9-
RUN npm install && \
10-
npm install cp-translations@$DEP_VERSION && \
8+
RUN yarn && \
9+
yarn add cp-translations@latest && \
1110
apk del build-base python && \
1211
rm -rf /tmp/* /root/.npm /root/.node-gyp
1312
EXPOSE 10303
14-
CMD ["npm", "start"]
13+
CMD ["yarn", "start"]

docker-entrypoint.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ set -e
33
cd /usr/src/app || exit
44
touch .pkg.sha1
55
OLD_SHA=$(cat .pkg.sha1)
6-
NEW_SHA=$(sha1sum package.json)
6+
NEW_SHA=$(sha1sum yarn.lock)
77
if [ "$OLD_SHA" != "$NEW_SHA" ]; then
88
echo "$NEW_SHA" > .pkg.sha1
9-
npm install
9+
yarn install
1010
rm -rf node_modules/cp-translations
1111
ln -s /usr/src/cp-translations node_modules/cp-translations
1212
fi
13-
npm run dev
13+
yarn dev

0 commit comments

Comments
 (0)