0
0

Docker files update

This commit is contained in:
Serghei Cebotari 2024-01-14 15:07:03 +03:00
parent 0eb65e2df2
commit 722a394d03
6 changed files with 35 additions and 30 deletions

View File

@ -1 +0,0 @@
[Dd]eploy/

View File

@ -1,4 +1,4 @@
FROM postgres:latest AS build FROM postgres:16.1 AS build
ADD ./init-database.sql /docker-entrypoint-initdb.d ADD ./init-database.sql /docker-entrypoint-initdb.d
RUN chmod 644 /docker-entrypoint-initdb.d/init-database.sql RUN chmod 644 /docker-entrypoint-initdb.d/init-database.sql
EXPOSE 5432 EXPOSE 5432

View File

@ -2,7 +2,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app WORKDIR /app
COPY . ./ COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0 FROM mcr.microsoft.com/dotnet/aspnet:8.0

View File

@ -1,27 +0,0 @@
version: '3'
services:
rhsolutions-api:
image: gitea.cebotari.ru/chebser/rhsolutions-api:latest
container_name: rhsolutions-api
ports:
- 5000:5000
environment:
- DB_HOST=rhsolutions-db
- DB_PORT=5432
- DB_DATABASE=rhsolutions
- DB_USER=chebser
- DB_PASSWORD=Rehau-987
depends_on:
- rhsolutions-db
restart: unless-stopped
rhsolutions-db:
image: gitea.cebotari.ru/chebser/rhsolutions-db:latest
container_name: rhsolutions-db
ports:
- 5432:5432
environment:
- POSTGRES_USER=chebser
- POSTGRES_PASSWORD=Rehau-987
- POSTGRES_DB=rhsolutions
restart: unless-stopped

34
docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
version: '3'
services:
app:
build: .
container_name: app
ports:
- 5000:5000
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_DATABASE=rhsolutions
- DB_USER=chebser
- DB_PASSWORD=Rehau-987
networks:
- rhsolutions
volumes:
- ./RhSolutions.Api/MLModels:/app/MLModels
depends_on:
- db
db:
build: Database/.
container_name: db
environment:
- POSTGRES_USER=chebser
- POSTGRES_PASSWORD=Rehau-987
- POSTGRES_DB=rhsolutions
volumes:
- db-data:/var/lib/postgresql/data
networks:
- rhsolutions
networks:
rhsolutions:
volumes:
db-data: