File tree Expand file tree Collapse file tree 7 files changed +125
-18
lines changed Expand file tree Collapse file tree 7 files changed +125
-18
lines changed Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2
+ ARG BUILD_CONFIGURATION=Release
3
+ ARG TARGETARCH
4
+ WORKDIR /src
5
+
6
+ COPY . .
7
+ RUN dotnet publish src/Billing -c $BUILD_CONFIGURATION -o /app/publish --arch $TARGETARCH /p:UseAppHost=false
8
+
9
+
10
+ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
11
+ USER $APP_UID
12
+ WORKDIR /app
13
+
14
+ COPY --from=build /app/publish .
15
+ ENTRYPOINT ["dotnet" , "Billing.dll" ]
Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2
+ ARG BUILD_CONFIGURATION=Release
3
+ ARG TARGETARCH
4
+ WORKDIR /src
5
+
6
+ COPY . .
7
+ RUN dotnet publish src/ClientUI -c $BUILD_CONFIGURATION -o /app/publish --arch $TARGETARCH /p:UseAppHost=false
8
+
9
+
10
+ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
11
+ USER $APP_UID
12
+ WORKDIR /app
13
+
14
+ COPY --from=build /app/publish .
15
+ ENTRYPOINT ["dotnet" , "ClientUI.dll" ]
Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2
+ ARG BUILD_CONFIGURATION=Release
3
+ ARG TARGETARCH
4
+ WORKDIR /src
5
+
6
+ COPY . .
7
+ RUN dotnet publish src/Sales -c $BUILD_CONFIGURATION -o /app/publish --arch $TARGETARCH /p:UseAppHost=false
8
+
9
+
10
+ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
11
+ USER $APP_UID
12
+ WORKDIR /app
13
+
14
+ COPY --from=build /app/publish .
15
+ ENTRYPOINT ["dotnet" , "Sales.dll" ]
Original file line number Diff line number Diff line change
1
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2
+ ARG BUILD_CONFIGURATION=Release
3
+ ARG TARGETARCH
4
+ WORKDIR /src
5
+
6
+ COPY . .
7
+ RUN dotnet publish src/Sales -c $BUILD_CONFIGURATION -o /app/publish --arch $TARGETARCH /p:UseAppHost=false
8
+
9
+
10
+ FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
11
+ USER $APP_UID
12
+ WORKDIR /app
13
+
14
+ COPY --from=build /app/publish .
15
+ ENTRYPOINT ["dotnet" , "Shipping.dll" ]
Original file line number Diff line number Diff line change @@ -43,15 +43,52 @@ services:
43
43
ENABLE_REVERSE_PROXY : false
44
44
SHOW_PENDING_RETRY : false
45
45
vue-app :
46
+ container_name : ui-app
46
47
build :
47
- context : ./frontend # Point to the frontend folder
48
- dockerfile : Dockerfile # Use the Dockerfile in the frontend folder
49
- container_name : vue-app-container
48
+ context : ./frontend # Path to the folder containing Dockerfile
49
+ dockerfile : Dockerfile
50
50
ports :
51
- - " 61335:8080" # Map port 8080 in the container to 61335 on the host
51
+ - " 8080:80" # Map port 80 in the container to port 8080 on the host
52
+ depends_on :
53
+ - billing
52
54
volumes :
53
- - ./frontend:/app # Mount the frontend folder into the container
54
- - /app/node_modules # Prevent overwriting node_modules
55
- command : " npm install && npm run dev" # Development mode command
55
+ - ./frontend:/app # Optional for hot reloading
56
+ restart : always
57
+ billing :
58
+ build :
59
+ context : ./
60
+ dockerfile : ./src/Billing/Dockerfile
61
+ container_name : billing
62
+ ports :
63
+ - " 5002:5002"
64
+ environment :
65
+ - ASPNETCORE_URLS=http://+:5002
66
+ shipping :
67
+ build :
68
+ context : ./
69
+ dockerfile : ./src/Shipping/Dockerfile
70
+ container_name : shipping
71
+ ports :
72
+ - " 5003:5003"
73
+ environment :
74
+ - ASPNETCORE_URLS=http://+:5003
75
+ sales :
76
+ build :
77
+ context : ./
78
+ dockerfile : ./src/Sales/Dockerfile
79
+ container_name : sales
80
+ ports :
81
+ - " 5001:5001"
82
+ environment :
83
+ - ASPNETCORE_URLS=http://+:5001
84
+ clientui :
85
+ build :
86
+ context : ./
87
+ dockerfile : ./src/ClientUI/Dockerfile
88
+ container_name : clientui
89
+ ports :
90
+ - " 5000:5000"
91
+ environment :
92
+ - ASPNETCORE_URLS=http://+:5000
56
93
volumes :
57
94
sc-data :
Original file line number Diff line number Diff line change
1
+ node_modules
2
+ dist
3
+ npm-debug.log
Original file line number Diff line number Diff line change 1
- FROM node:lts-alpine
1
+ # Use an official Node.js runtime as the base image
2
+ FROM node:18 AS build-stage
2
3
3
- # install simple http server for serving static content
4
- RUN npm install -g http-server
5
-
6
- # make the 'app' folder the current working directory
4
+ # Set the working directory
7
5
WORKDIR /app
8
6
9
- # copy both ' package.json' and ' package-lock.json' (if available)
7
+ # Copy package.json and package-lock.json
10
8
COPY package*.json ./
11
9
12
- # install project dependencies
10
+ # Install dependencies
13
11
RUN npm install
14
12
15
- # copy project files and folders to the current working directory (i.e. 'app' folder)
13
+ # Copy the rest of the application code
16
14
COPY . .
17
15
18
- # build app for production with minification
16
+ # Build the application
19
17
RUN npm run build
20
18
21
- EXPOSE 8080
22
- CMD [ "http-server" , "dist" ]
19
+ # Use an official Nginx image to serve the content
20
+ FROM nginx:alpine AS production-stage
21
+
22
+ # Copy the build output to Nginx's HTML directory
23
+ COPY --from=build-stage /app/dist /usr/share/nginx/html
24
+
25
+ # Expose port 80
26
+ EXPOSE 80
27
+
28
+ # Start Nginx
29
+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments