Skip to content

Commit

Permalink
misc: update Dockerfile to build faster
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-imba committed Jul 22, 2019
1 parent 91d398e commit 0b6ef40
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,29 @@ RUN apt-get update && \
ENV NVM_DIR="$HOME/.nvm"
RUN \. "$NVM_DIR/nvm.sh" && nvm install 9

# Copy the cb4 files
COPY ./scripts /srv/cb4/scripts
COPY ./vj4 /srv/cb4/vj4
COPY ./.git /srv/cb4/.git
# Enable IP Geo-Location
RUN curl "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz" | gunzip -c > GeoLite2-City.mmdb

# Copy the cb4 dependencies
COPY ./package.json ./requirements.txt /srv/cb4/
COPY ./pm /usr/local/bin/
WORKDIR /srv/cb4

# Install python dependencies and build node modules
# Install python and node dependencies
RUN \. "$NVM_DIR/nvm.sh" && nvm use 9 && \
npm install --registry=https://registry.npm.taobao.org && npm run build
npm install --registry=https://registry.npm.taobao.org
RUN pip3 install -r ./requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

# Enable IP Geo-Location
RUN curl "http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz" | gunzip -c > GeoLite2-City.mmdb
# Build node modules
COPY ./vj4/ui /srv/cb4/vj4/ui
RUN npm run build

# Copy the cb4 files
COPY ./scripts /srv/cb4/scripts
COPY ./vj4 /srv/cb4/vj4
COPY ./.git /srv/cb4/.git
COPY ./pm /usr/local/bin/

# Start the server

ENV HOST="localhost" \
PORT=34765 \
Expand Down

0 comments on commit 0b6ef40

Please sign in to comment.