提交 0b637906 编写于 作者: 麦壳饼's avatar 麦壳饼

修改docker

上级 d95bd9d2
...@@ -10,9 +10,9 @@ RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib n ...@@ -10,9 +10,9 @@ RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib n
apt-get -y -q update && apt-get install -y -q apt-utils libgdiplus libc6-dev lsof net-tools wget sqlite3 python3 bashtop iputils-ping inetutils-tools libssl-dev libssl1.0.0 curl && \ apt-get -y -q update && apt-get install -y -q apt-utils libgdiplus libc6-dev lsof net-tools wget sqlite3 python3 bashtop iputils-ping inetutils-tools libssl-dev libssl1.0.0 curl && \
apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf && \ apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN curl -o TDengine-client.tar.gz "https://www.taosdata.com/download/download-gettingStarted.php?pkg=tdengine_linux&pkgName=TDengine-client-2.0.12.0-Linux-x64.tar.gz" && \ #RUN curl -o TDengine-client.tar.gz "https://www.taosdata.com/download/download-gettingStarted.php?pkg=tdengine_linux&pkgName=TDengine-client-2.0.12.0-Linux-x64.tar.gz" && \
tar -xzvf TDengine-client.tar.gz && rm TDengine-client.tar.gz -f && cd $(ls TDengine-client* -d) && ./install_client.sh && \ #tar -xzvf TDengine-client.tar.gz && rm TDengine-client.tar.gz -f && cd $(ls TDengine-client* -d) && ./install_client.sh && \
rm $(pwd) -rf #rm $(pwd) -rf
RUN echo "fs.file-max=6553500" >> /etc/sysctl.conf && \ RUN echo "fs.file-max=6553500" >> /etc/sysctl.conf && \
echo "* soft nofile 65535" >> /etc/security/limits.conf && \ echo "* soft nofile 65535" >> /etc/security/limits.conf && \
echo "* hard nofile 65535" >> /etc/security/limits.conf && \ echo "* hard nofile 65535" >> /etc/security/limits.conf && \
...@@ -28,14 +28,26 @@ EXPOSE 8080 ...@@ -28,14 +28,26 @@ EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list && \ RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list && \ echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \ echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free" >> /etc/apt/sources.list && \ apt-get -y -q update && apt-get install -y -q git libssl-dev curl gnupg libcurl4 && \
apt-get -y -q update && apt-get install -y -q git libssl-dev curl gnupg libcurl4 libssl1.0.0 && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y -q nodejs && \
apt remove cmdtest && \
apt remove yarn && \
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null && \
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get install -y -q yarn
RUN apt-get autoremove -y && apt-get clean && apt-get autoclean && rm /var/cache/apt/* -rf
WORKDIR /src WORKDIR /src
COPY ["IoTSharp/IoTSharp.csproj", "IoTSharp/"] COPY ["IoTSharp/IoTSharp.csproj", "IoTSharp/"]
COPY ["IoTSharp.Data/IoTSharp.Data.csproj", "IoTSharp.Data/"] COPY ["IoTSharp.Data/IoTSharp.Data.csproj", "IoTSharp.Data/"]
...@@ -48,25 +60,17 @@ RUN dotnet restore "IoTSharp/IoTSharp.csproj" ...@@ -48,25 +60,17 @@ RUN dotnet restore "IoTSharp/IoTSharp.csproj"
COPY . . COPY . .
WORKDIR "/src/IoTSharp" WORKDIR "/src/IoTSharp"
RUN dotnet build "IoTSharp.csproj" -c Release -o /app/build RUN dotnet build "IoTSharp.csproj" -c Release -o /app/build
FROM node:14-buster AS web
WORKDIR /web WORKDIR /web
RUN npm config set registry http://registry.npm.taobao.org/ && \ COPY ../ClientApp/Vue/package*.json .
yarn config set registry http://registry.npm.taobao.org/
COPY ../ClientApp/Vue/package*.json ./
RUN yarn install RUN yarn install
COPY ../ClientApp/Vue ./ COPY ../ClientApp/Vue .
RUN yarn build RUN yarn build
FROM build AS publish FROM build AS publish
RUN dotnet publish "IoTSharp.csproj" -c Release -o /app/publish RUN dotnet publish "IoTSharp.csproj" -c Release -o /app/publish
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
COPY --from=web /web/dist ./wwwroot
ENTRYPOINT ["dotnet", "IoTSharp.dll"] ENTRYPOINT ["dotnet", "IoTSharp.dll"]
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册