updated Dockerfile

This commit is contained in:
marvzhang
2021-07-27 14:43:57 +08:00
parent 7d5070efcc
commit 84c45ca58f
6 changed files with 8 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ WORKDIR /app
#RUN npm config set unsafe-perm true
#RUN npm install -g yarn && yarn install
RUN yarn install && yarn run build
RUN yarn install && yarn run build:docker
# images
FROM ubuntu:latest

View File

@@ -19,7 +19,7 @@ RUN rm /app/.npmrc
#RUN npm config set unsafe-perm true
#RUN npm install -g yarn && yarn install
RUN yarn install && yarn run build
RUN yarn install && yarn run build:docker
# images
FROM ubuntu:latest

View File

@@ -41,15 +41,14 @@ Three methods:
### Pre-requisite (Docker)
- Docker 18.03+
- Redis 5.x+
- MongoDB 3.6+
- Docker Compose 1.24+ (optional but recommended)
### Pre-requisite (Direct Deploy)
- Go 1.12+
- Node 8.12+
- Redis 5.x+
- MongoDB 3.6+
- SeaweedFS
## Quick Start

View File

@@ -1,8 +1,8 @@
#!/bin/bash
# replace absolute api url to relative
jspath=`ls /app/dist/js/app.*.js`
sed -i "s?http:\/\/localhost:8000?\/api?g" ${jspath}
jspath=`ls /app/dist/js/index.*.js`
sed -i "s?###VUE_APP_API_BASE_URL###?\/api?g" ${jspath}
# replace default api path to new one
# if [ "${CRAWLAB_API_ADDRESS}" = "" ];

2
frontend/.env.docker Normal file
View File

@@ -0,0 +1,2 @@
NODE_ENV='production'
VUE_APP_API_BASE_URL='VUE_APP_API_BASE_URL'

View File

@@ -5,6 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve --port=8081",
"build": "vue-cli-service build",
"build:docker": "vue-cli-service build --mode docker",
"lint": "vue-cli-service lint",
"test": "jest"
},