Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.

Commit

Permalink
build: Add docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosPavajeau committed May 25, 2021
1 parent 3349164 commit ddb5b65
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Directories
**/bin/
**/obj/
**/out/
**/node_modules/
node_modules

# Files
Dockerfile*
**/*.md
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /app

# copy csproj and restore as distinct layers
COPY . .
RUN dotnet restore

# build app
WORKDIR /app/Kaizen
RUN dotnet build -c Release --no-restore

# publish app
FROM build as publish
RUN dotnet publish -c Release -o /out --no-restore

# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim
WORKDIR /app
EXPOSE 80
EXPOSE 443

COPY --from=publish /out .
ENTRYPOINT [ "dotnet", "Kaizen.dll" ]
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "3.7"

services:
kaizen_web:
build: .
container_name: kaizen
ports:
- "3000:3000"
depends_on:
- kaizen_database
kaizen_database:
image: "mysql:latest"
container_name: kayzen_mysql_server
command: "--default-authentication-plugin=mysql_native_password"
restart: "always"
environment:
MYSQL_ROOT_PASSWORD: "kaizen_db_password"
MYSQL_DATABASE: kaizen
volumes:
kaizen_data:

0 comments on commit ddb5b65

Please sign in to comment.