Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 5265537

Browse files
building the client during the build
1 parent 756ada8 commit 5265537

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

Dockerfile

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
FROM microsoft/dotnet:2.2.102-sdk-stretch AS build
1+
FROM node:10.12.0-alpine AS build-javascript
2+
ARG CLIENT_VERSION=0.9.2
3+
ARG NPM_REGISTRY=https://registry.npmjs.org
4+
ARG CLIENT_PACKAGE=@sqlstreamstore/browser
5+
6+
WORKDIR /app
7+
8+
RUN echo "@sqlstreamstore:registry=${NPM_REGISTRY}" > .npmrc && \
9+
yarn init --yes && \
10+
yarn add ${CLIENT_PACKAGE}@${CLIENT_VERSION}
11+
12+
WORKDIR /app/node_modules/${CLIENT_PACKAGE}
13+
14+
RUN yarn && \
15+
yarn react-scripts-ts build
16+
17+
FROM microsoft/dotnet:2.2.102-sdk-stretch AS build-dotnet
18+
ARG CLIENT_PACKAGE=@sqlstreamstore/browser
219

320
WORKDIR /app
421

@@ -27,6 +44,8 @@ WORKDIR /app/src
2744

2845
COPY ./src .
2946

47+
COPY --from=build-javascript /app/node_modules/${CLIENT_PACKAGE}/build /app/src/SqlStreamStore.Server/Browser/build
48+
3049
WORKDIR /app/build
3150

3251
COPY ./build/build.csproj .
@@ -35,17 +54,14 @@ RUN dotnet restore
3554

3655
COPY ./build .
3756

38-
COPY --from=sqlstreamstore/browser:0.9 /var/www /app/src/SqlStreamStore.Server/Browser/build
39-
4057
WORKDIR /app
4158

42-
RUN MYGET_API_KEY=$MYGET_API_KEY \
43-
dotnet run --project build/build.csproj
59+
RUN dotnet run --project build/build.csproj
4460

4561
FROM microsoft/dotnet:2.2.1-runtime-deps-alpine3.8 AS runtime
4662

4763
WORKDIR /app
48-
COPY --from=build /app/.version ./
49-
COPY --from=build /app/publish ./
64+
COPY --from=build-dotnet /app/.version ./
65+
COPY --from=build-dotnet /app/publish ./
5066

5167
ENTRYPOINT ["/app/SqlStreamStore.Server"]

0 commit comments

Comments
 (0)