-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add Dockerfiles for all servers & enable docker compose
- Loading branch information
Showing
6 changed files
with
159 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**/Dockerfile | ||
**/bin | ||
**/obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /app | ||
|
||
# restore all project dependencies | ||
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/ | ||
RUN dotnet restore /app/Streetwriters.Data/Streetwriters.Data.csproj --use-current-runtime | ||
|
||
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/ | ||
RUN dotnet restore /app/Streetwriters.Common/Streetwriters.Common.csproj --use-current-runtime | ||
|
||
COPY Notesnook.API/*.csproj ./Notesnook.API/ | ||
RUN dotnet restore /app/Notesnook.API/Notesnook.API.csproj --use-current-runtime | ||
|
||
# copy everything else | ||
COPY Streetwriters.Data/ ./Streetwriters.Data/ | ||
COPY Streetwriters.Common/ ./Streetwriters.Common/ | ||
COPY Notesnook.API/ ./Notesnook.API/ | ||
|
||
# build | ||
WORKDIR /app/Notesnook.API/ | ||
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" | ||
RUN dotnet publish -c Release -o /app/out --use-current-runtime --self-contained false --no-restore | ||
|
||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 | ||
WORKDIR /app | ||
COPY --from=build /app/out . | ||
ENTRYPOINT ["dotnet", "Notesnook.API.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /app | ||
|
||
# restore all project dependencies | ||
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/ | ||
RUN dotnet restore /app/Streetwriters.Data/Streetwriters.Data.csproj --use-current-runtime | ||
|
||
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/ | ||
RUN dotnet restore /app/Streetwriters.Common/Streetwriters.Common.csproj --use-current-runtime | ||
|
||
COPY Streetwriters.Identity/*.csproj ./Streetwriters.Identity/ | ||
RUN dotnet restore /app/Streetwriters.Identity/Streetwriters.Identity.csproj --use-current-runtime | ||
|
||
# copy everything else | ||
COPY Streetwriters.Data/ ./Streetwriters.Data/ | ||
COPY Streetwriters.Common/ ./Streetwriters.Common/ | ||
COPY Streetwriters.Identity/ ./Streetwriters.Identity/ | ||
|
||
# build | ||
WORKDIR /app/Streetwriters.Identity/ | ||
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" | ||
RUN dotnet publish -c Release -o /app/out --use-current-runtime --self-contained false --no-restore | ||
|
||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 | ||
WORKDIR /app | ||
COPY --from=build /app/out . | ||
ENTRYPOINT ["dotnet", "Streetwriters.Identity.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
WORKDIR /app | ||
|
||
# restore all project dependencies | ||
COPY Streetwriters.Data/*.csproj ./Streetwriters.Data/ | ||
RUN dotnet restore /app/Streetwriters.Data/Streetwriters.Data.csproj --use-current-runtime | ||
|
||
COPY Streetwriters.Common/*.csproj ./Streetwriters.Common/ | ||
RUN dotnet restore /app/Streetwriters.Common/Streetwriters.Common.csproj --use-current-runtime | ||
|
||
COPY Streetwriters.Messenger/*.csproj ./Streetwriters.Messenger/ | ||
RUN dotnet restore /app/Streetwriters.Messenger/Streetwriters.Messenger.csproj --use-current-runtime | ||
|
||
# copy everything else | ||
COPY Streetwriters.Data/ ./Streetwriters.Data/ | ||
COPY Streetwriters.Common/ ./Streetwriters.Common/ | ||
COPY Streetwriters.Messenger/ ./Streetwriters.Messenger/ | ||
|
||
# build | ||
WORKDIR /app/Streetwriters.Messenger/ | ||
ENV DOTNET_TC_QuickJitForLoops="1" DOTNET_ReadyToRun="0" DOTNET_TieredPGO="1" DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="true" | ||
RUN dotnet publish -c Release -o /app/out --use-current-runtime --self-contained false --no-restore | ||
|
||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 | ||
WORKDIR /app | ||
COPY --from=build /app/out . | ||
ENTRYPOINT ["dotnet", "Streetwriters.Messenger.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
version: "3.4" | ||
|
||
x-server-discovery: | ||
&server-discovery | ||
NOTESNOOK_SERVER_PORT: 80 | ||
NOTESNOOK_SERVER_HOST: notesnook-server | ||
IDENTITY_SERVER_PORT: 80 | ||
IDENTITY_SERVER_HOST: identity-server | ||
SSE_SERVER_PORT: 80 | ||
SSE_SERVER_HOST: sse-server | ||
SELF_HOSTED: 1 | ||
|
||
services: | ||
notesnook-db: | ||
image: mongo | ||
networks: | ||
- notesnook | ||
volumes: | ||
- /data/db | ||
|
||
notesnook-server: | ||
build: | ||
context: . | ||
dockerfile: ./Notesnook.API/Dockerfile | ||
ports: | ||
- "5264:80" | ||
networks: | ||
- notesnook | ||
environment: | ||
<<: *server-discovery | ||
MONGODB_CONNECTION_STRING: mongodb://notesnook-db:27017/notesnook | ||
MONGODB_DATABASE_NAME: notesnook | ||
|
||
identity-server: | ||
build: | ||
context: . | ||
dockerfile: ./Streetwriters.Identity/Dockerfile | ||
ports: | ||
- "8264:80" | ||
networks: | ||
- notesnook | ||
environment: | ||
<<: *server-discovery | ||
MONGODB_CONNECTION_STRING: mongodb://notesnook-db:27017/identity | ||
MONGODB_DATABASE_NAME: identity | ||
|
||
sse-server: | ||
build: | ||
context: . | ||
dockerfile: ./Streetwriters.Messenger/Dockerfile | ||
ports: | ||
- "7264:80" | ||
networks: | ||
- notesnook | ||
environment: | ||
<<: *server-discovery | ||
|
||
networks: | ||
notesnook: |