feat: docker & docker-compose files added
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Dockerfile
|
||||
|
||||
# Base image for runtime
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 85
|
||||
|
||||
# Build image
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# Copy the main project file and restore
|
||||
COPY Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj Core.Thalos.DAL.API/
|
||||
COPY Core.Thalos.Domain/Core.Thalos.Domain.csproj Core.Thalos.Domain/
|
||||
COPY Core.Thalos.Infraestructure/Core.Thalos.Infraestructure.csproj Core.Thalos.Infraestructure/
|
||||
COPY Core.Thalos.Provider/Core.Thalos.Provider.csproj Core.Thalos.Provider/
|
||||
|
||||
RUN dotnet restore Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj
|
||||
|
||||
# Copy everything else and build
|
||||
COPY . .
|
||||
WORKDIR /src/Core.Thalos.DAL.API
|
||||
RUN dotnet publish Core.Thalos.DAL.API.csproj -c Release -o /app/publish
|
||||
|
||||
# Final image
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Core.Thalos.DAL.API.dll"]
|
||||
39
docker-compose.yml
Normal file
39
docker-compose.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
thalos-dal:
|
||||
image: thalos-dal:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "5000:85" # Expose only if you need access to this API externally
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ConnectionStrings__MongoDB=mongodb://admin_agile:Admin%40agileWebs@mongodb:27017/?authMechanism=SCRAM-SHA-256
|
||||
- ConnectionStrings__Redis=redis:6379
|
||||
depends_on:
|
||||
- mongodb
|
||||
- redis
|
||||
networks:
|
||||
- thalos-net
|
||||
|
||||
mongodb:
|
||||
image: mongo:7
|
||||
container_name: thalos-mongodb
|
||||
volumes:
|
||||
- mongo-data:/data/db
|
||||
networks:
|
||||
- thalos-net
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
container_name: thalos-redis
|
||||
networks:
|
||||
- thalos-net
|
||||
|
||||
volumes:
|
||||
mongo-data:
|
||||
|
||||
networks:
|
||||
thalos-net:
|
||||
Reference in New Issue
Block a user