Docker changes
This commit is contained in:
parent
389f98e1d3
commit
5eff87dd11
@ -1,2 +1,12 @@
|
||||
# database file
|
||||
Database/*
|
||||
# directories
|
||||
**/bin/
|
||||
**/obj/
|
||||
**/out/
|
||||
|
||||
# files
|
||||
Dockerfile*
|
||||
**/*.trx
|
||||
**/*.md
|
||||
**/*.ps1
|
||||
**/*.cmd
|
||||
**/*.sh
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -457,6 +457,7 @@ $RECYCLE.BIN/
|
||||
wwwroot/lib/*
|
||||
|
||||
# image content
|
||||
wwwroot/Content/*
|
||||
wwwroot/content/*
|
||||
|
||||
# database files
|
||||
|
@ -5,12 +5,15 @@ COPY . ./
|
||||
RUN dotnet restore
|
||||
RUN dotnet tool restore
|
||||
RUN dotnet libman restore
|
||||
RUN dotnet ef database update
|
||||
RUN dotnet ef database update --context DataContext
|
||||
RUN dotnet ef database update --context IdentityContext
|
||||
|
||||
RUN dotnet publish -c Release -o out
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
EXPOSE 5000
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/out .
|
||||
COPY --from=build /app/Database ./Database
|
||||
ENV ASPNETCORE_ENVIRONMENT Production
|
||||
ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ]
|
@ -3,9 +3,15 @@ version: '3'
|
||||
services:
|
||||
my-darling:
|
||||
build: .
|
||||
container_name: mydarling-net
|
||||
container_name: mydarling-dotnet
|
||||
ports:
|
||||
- "5050:5000"
|
||||
volumes:
|
||||
- ./Database:/app/Database
|
||||
- ./wwwroot/content:/app/wwwroot/content
|
||||
- db:/app/Database
|
||||
- content:/app/wwwroot/content
|
||||
environment:
|
||||
- ADMIN_PASSWORD=He110World!
|
||||
|
||||
volumes:
|
||||
db:
|
||||
content:
|
Loading…
Reference in New Issue
Block a user