generated from StraykerPL/PaternRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Docker containers for Web Frontend and Web Backend
- Loading branch information
Showing
5 changed files
with
89 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
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,13 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"ConnectionStrings": { | ||
"DefaultConnection": "Server=localhost;Port=3306;Database=binder_db;User Id=newuser;Pwd=example;" | ||
}, | ||
"FrontendUrl": "http://localhost:4200", | ||
"BackendUrl": "http://localhost:5246" | ||
} |
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,25 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
COPY binder-web-backend/Binder.sln binder-web-backend/Binder.sln | ||
COPY binder-web-backend/Binder.Api/Binder.Api.csproj binder-web-backend/Binder.Api/Binder.Api.csproj | ||
COPY binder-web-backend/Binder.Application/Binder.Application.csproj binder-web-backend/Binder.Application/Binder.Application.csproj | ||
COPY binder-web-backend/Binder.Core/Binder.Core.csproj binder-web-backend/Binder.Core/Binder.Core.csproj | ||
COPY binder-web-backend/Binder.IntegrationTests/Binder.IntegrationTests.csproj binder-web-backend/Binder.IntegrationTests/Binder.IntegrationTests.csproj | ||
COPY binder-web-backend/Binder.Persistence/Binder.Persistence.csproj binder-web-backend/Binder.Persistence/Binder.Persistence.csproj | ||
COPY binder-web-backend/Binder.UnitTests/Binder.UnitTests.csproj binder-web-backend/Binder.UnitTests/Binder.UnitTests.csproj | ||
|
||
RUN dotnet restore binder-web-backend/Binder.sln | ||
|
||
COPY binder-web-backend/Binder.Api binder-web-backend/Binder.Api | ||
COPY binder-web-backend/Binder.Application binder-web-backend/Binder.Application | ||
COPY binder-web-backend/Binder.Persistence binder-web-backend/Binder.Persistence | ||
COPY binder-web-backend/Binder.Core binder-web-backend/Binder.Core | ||
WORKDIR /app/binder-web-backend | ||
RUN dotnet publish -c Release -o /app/binder-web-backend/out | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 | ||
WORKDIR /app | ||
COPY --from=build /app/binder-web-backend/out . | ||
ENTRYPOINT [ "dotnet", "Binder.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,15 @@ | ||
FROM node:18.10.0 as builder | ||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
RUN npm install | ||
RUN npm run prepare-husky | ||
|
||
COPY . . | ||
|
||
EXPOSE 4200 | ||
|
||
ENV PORT 4200 | ||
|
||
CMD ["npm", "run", "dev"] |
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,35 @@ | ||
version: '3.7' | ||
services: | ||
database: | ||
image: mysql:5.7 | ||
restart: 'always' | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 'Root0++' | ||
MYSQL_USER: 'newuser' | ||
MYSQL_ROOT_HOST: 'localhost' | ||
MYSQL_PASSWORD: 'pass@word1234' | ||
MYSQL_DATABASE: 'binder_db' | ||
ports: | ||
- '3306:3306' | ||
|
||
api: | ||
build: | ||
context: . | ||
dockerfile: binder-web-backend/Dockerfile | ||
depends_on: | ||
- database | ||
ports: | ||
- '5246:80' | ||
restart: always | ||
environment: | ||
DBHOST: database | ||
ASPNETCORE_ENVIRONMENT: Docker | ||
ASPNETCORE_URLS: http://+:80 | ||
ConnectionStrings__DefaultConnection: 'Server=database;Port=3306;Database=binder_db;User Id=newuser;Pwd=pass@word1234;' | ||
|
||
angular-app: | ||
build: | ||
context: binder-web-frontend/. | ||
dockerfile: Dockerfile | ||
ports: | ||
- '4200:4200' |