forked from firemakergk/aquar-home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
20 lines (19 loc) · 1.16 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ARG NPM_REGISTRY=https://registry.npm.taobao.org
FROM node:14-slim
ARG NPM_REGISTRY
WORKDIR /tmp
RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget rsync && npm install -g pm2 && wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz && wget https://bootstrap.pypa.io/get-pip.py && tar -xf Python-3.8.9.tgz
RUN cd Python-3.8.9 && ./configure --enable-optimizations && make install && python3 /tmp/get-pip.py
WORKDIR /app/aquar_home/aquar_home_front
COPY ./aquar_home_front/ ./
RUN npm install --registry ${NPM_REGISTRY} && npm run build
WORKDIR /app/aquar_home/aquar_home_server
COPY ./aquar_home_server/ ./
RUN PYTHON=python3 npm install --unsafe-perm --registry ${NPM_REGISTRY}
WORKDIR /app/aquar_home
RUN rm -rf ./aquar_home_server/public/ && mkdir -p aquar_home_server/public/ && cp -r ./aquar_home_front/dist/* ./aquar_home_server/public/
EXPOSE 8172
VOLUME ["/var/aquardata"]
VOLUME ["/opt/aquarpool"]
VOLUME ["/root/.pm2/logs"]
CMD ["/bin/sh", "-c", "cd /app/aquar_home/aquar_home_server/ && mkdir -p /var/aquardata/log/ && npm run dcprd > /root/.pm2/logs/aquar_home.log 2>&1"]