forked from PSW-2020-ORG1/MedbayTech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.Pharmacies
82 lines (54 loc) · 2.27 KB
/
Dockerfile.Pharmacies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
# WORKDIR /app
# COPY MedbayTech.Common/MedbayTech.Common.csproj MedbayTech.Common/
# COPY MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj MedbayTech.Pharmacies/
# RUN dotnet restore MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj
# COPY . .
# FROM build AS publish
# WORKDIR /app/MedbayTech.Pharmacies
# ENV PATH $PATH:/root/.dotnet/tools
# RUN dotnet tool install -g dotnet-ef --version 3.1.9
# RUN dotnet ef migrations add Init
# WORKDIR /app
# RUN dotnet publish MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj -c Release -o out
# FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS runtime
# RUN useradd -ms /bin/bash defaultuser
# WORKDIR /app
# COPY --from=publish /app/out .
# EXPOSE 5005
# CMD ASPNETCORE_URLS=http://*:$PORT dotnet MedbayTech.Pharmacies.dll
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build
RUN apk add --update nodejs nodejs-npm
RUN mkdir /src
WORKDIR /src
COPY MedbayTech.Common/MedbayTech.Common.csproj MedbayTech.Common/
COPY MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj MedbayTech.Pharmacies/
RUN dotnet restore MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj
COPY . ./
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk
RUN apk add glibc-2.32-r0.apk
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS buildbuster
WORKDIR /app
COPY --from=build /src .
WORKDIR /app/MedbayTech.Pharmacies
ENV PATH $PATH:/root/.dotnet/tools
RUN dotnet tool install -g dotnet-ef --version 3.1.9
RUN dotnet ef migrations add Init
WORKDIR /app
RUN dotnet publish MedbayTech.Pharmacies/MedbayTech.Pharmacies.csproj -c Release
COPY . ./
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine as buildfront
WORKDIR /app
COPY --from=buildbuster /app .
COPY --from=buildbuster /app/MedbayTech.PharmacyUI /app/MedbayTech.PharmacyUI
RUN apk add --update nodejs nodejs-npm
WORKDIR /app/MedbayTech.PharmacyUI
RUN npm install
RUN npm install -g @vue/cli
RUN npm install --save axios vue-axios
RUN npm run build
WORKDIR /app/MedbayTech.Pharmacies/bin/Release/netcoreapp3.1/publish
EXPOSE 5005
EXPOSE 50202
ENTRYPOINT [ "dotnet", "MedbayTech.Pharmacies.dll" ]