File tree Expand file tree Collapse file tree 6 files changed +5123
-5355
lines changed Expand file tree Collapse file tree 6 files changed +5123
-5355
lines changed Original file line number Diff line number Diff line change 1- package-lock = false
21scripts-prepend-node-path = true
2+ registry = https://registry.npm.taobao.org
3+ sass-binary-site = https://npm.taobao.org/mirrors/node-sass
Original file line number Diff line number Diff line change 1+ FROM node:12-alpine as builder
2+ MAINTAINER sunnyw <sunnywang@yunify.com>
3+
4+ ENV SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass
5+ ENV PATH=$PATH:/home/node_modules/.bin
6+
7+ WORKDIR /home/app
8+
9+ RUN mkdir -p /home/app
10+
11+ RUN npm config set registry https://registry.npm.taobao.org
12+
13+ COPY package.json yarn.lock /tmp/
14+
15+ # generate dev node modules and prod node modules
16+ RUN cd /tmp && mkdir -p node_modules \
17+ && yarn install --pure-lockfile --prefer-offline \
18+ && mv node_modules dev_node_modules \
19+ && NODE_ENV=production yarn install --pure-lockfile --prod --prefer-offline \
20+ && mv node_modules prod_node_modules \
21+ && mv dev_node_modules node_modules
22+
23+ COPY . /home/app
24+
25+ RUN cd /home/app && \
26+ ln -fs /tmp/node_modules && \
27+ yarn prod:build
28+
29+
30+ FROM yobasystems/alpine-nodejs:min-aarch64
31+
32+ ENV NODE_ENV=production
33+
34+ WORKDIR /home/app
35+
36+ RUN mkdir -p /home/app
37+
38+ COPY --from=builder /home/app /home/app
39+ COPY --from=builder /tmp/prod_node_modules /home/app/node_modules
40+
41+ EXPOSE 8000
42+
43+ CMD ["npm", "run", "prod:serve"]
Original file line number Diff line number Diff line change @@ -49,3 +49,12 @@ docker-tag:
4949 docker build --cache-from ${repo} :latest -t ${repo} :${tag} .
5050 docker push ${repo} :${tag}
5151
52+ build-arm : Dockerfile.arm
53+ @echo building image for ARM platform
54+ docker build -f Dockerfile.arm -t op/web-app-arm .
55+
56+ run-arm :
57+ @echo up and running openpitrix-dashboard in ARM platform
58+ docker run -p 8000:8000 --rm \
59+ --name openpitrix-dashboard-arm \
60+ -v " $( cwd) " /server/local_config.yml:/home/app/server/local_config.yml op/web-app-arm
Original file line number Diff line number Diff line change 1414```
1515git clone https://github.com/openpitrix/dashboard.git
1616cd dashboard
17- yarn
17+ yarn
1818yarn dev
1919```
2020
21- Or you can running dashboard in ` docker ` :
21+ ## Docker
22+
23+ You can run dashboard in ` docker ` :
2224
2325```
2426docker pull openpitrix/dashboard
25- docker run -d --name openpitrix-dashborad -p 8000:8000 openpitrix/dashboard
27+ docker run -d --rm --name openpitrix-dashborad -p 8000:8000 openpitrix/dashboard
28+ ```
29+
30+ Then open your favorite browser: ` http://localhost:8000 `
31+
32+ ## Build for ARM platform
33+
34+ We also support running ` openpitrix/dashboard ` in ARM platform using docker
35+
36+ See build steps in ` Dockerfile.arm `
37+
38+ If you want try local build for ARM:
39+
40+ ```
41+ make build-arm
42+ make run-arm
43+ ```
44+
45+ Or running our official arm64 image from docker hub:
46+
47+ ```
48+ docker pull openpitrix/dashboard:min-arm64
49+ docker run -d --rm --name openpitrix-dashborad-arm -p 8000:8000 openpitrix/dashboard:min-arm64
2650```
27- Then open your browser: ` http://localhost:8000 `
2851
2952## Develop
53+
3054```
31- yarn
55+ yarn
3256yarn dev
3357```
3458
3559We prefer ` yarn ` as our package manager, if you like ` npm ` :
60+
3661```
3762npm i
3863npm run dev
@@ -41,26 +66,22 @@ npm run dev
4166See [ How to install requsites] ( ./docs/install.md )
4267
4368## Test
69+
4470```
4571yarn test
4672```
4773
4874## Build
4975
5076For production build:
77+
5178```
5279yarn prod:build
5380```
54- Or using ` npm ` :
55- ```
56- npm run prod:build
57- ```
58-
5981
6082## Quick start
6183
62- * [ Deploy wordpress on QingCloud using openpitrix] ( ./docs/quick-start.md )
63-
84+ - [ Deploy wordpress on QingCloud using openpitrix] ( ./docs/quick-start.md )
6485
6586## License
6687
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- set -e
3+ set -ex
44
55REPO=openpitrix/dashboard
66COMMIT=$( git rev-parse --short HEAD)
7+ TAG=${1:- latest}
78
8- echo " $DOCKER_PASS " | docker login -u " $DOCKER_USER " --password-stdin
9+ cat ~ /docker_pass.txt | docker login --username iwisunny --password-stdin
910
1011echo " Pulling remote latest image to reuse docker cache"
1112docker pull $REPO :latest
@@ -14,7 +15,7 @@ echo "Building docker image from git HEAD commit: $COMMIT"
1415docker build --cache-from $REPO :latest -t $REPO :$COMMIT .
1516
1617echo " Tag $REPO :$COMMIT as latest image"
17- docker tag $REPO :$COMMIT $REPO :latest
18+ docker tag $REPO :$COMMIT $REPO :$TAG
1819
1920echo " Push latest image to docker hub"
20- docker push $REPO :latest
21+ docker push $REPO :$TAG
You can’t perform that action at this time.
0 commit comments