Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Commit

Permalink
Заменил MSSQL на PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
nzour committed Jul 1, 2019
1 parent f3824ad commit 2a3b3a6
Show file tree
Hide file tree
Showing 17 changed files with 376 additions and 416 deletions.
1 change: 0 additions & 1 deletion .idea/.idea.backend.dir/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

321 changes: 169 additions & 152 deletions .idea/.idea.backend.dir/.idea/workspace.xml

Large diffs are not rendered by default.

36 changes: 9 additions & 27 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,14 @@ services:
- ASPNETCORE_ENVIRONMENT=Development
volumes:
- ./src:/app

mssql:
container_name: mssql
build: docker/mssql/.
hostname: mssql

postgres:
container_name: postgres
image: postgres:latest
ports:
- 1433:1433
- 5022:5022
volumes:
- ./database/data:/var/opt/mssql
- ./database/backups:/backups
- 5432:5432
environment:
- "ACCEPT_EULA=Y"
- "SA_PASSWORD=1234" #PASSWORD
- "MSSQL_PID=Express"
- "MSSQL_LCID=1049" # русский
- "MSSQL_COLLATION=1049"
- "MSSQL_MEMORY_LIMIT_MB=3500" #задает максимальный объем памяти (в МБ), который можно использовать SQL Server. По умолчанию он составляет 80% от общего объема физической памяти.
- "MSSQL_TCP_PORT=1433"
- "MSSQL_IP_ADDRESS=0.0.0.0"
- "MSSQL_BACKUP_DIR=/backups" #Задайте расположение каталога резервного копирования по умолчанию.
- "MSSQL_DATA_DIR=/var/opt/mssql/data" #Перейдите в каталог, где создаются новые базы данных файлы данных SQL Server (.mdf).
- "MSSQL_LOG_DIR=/var/opt/mssql/log" #где создаются новые файлы журналов (LDF) базы данных SQL Server.
- "MSSQL_DUMP_DIR=/var/opt/mssql/dumps" #где SQL Server будет Депонировать дампы памяти и другие файлы для устранения неполадок по умолчанию.
- "MSSQL_ENABLE_HADR=0" #Включение группы доступности. Например "1" включена и отключена "0" - репликация
- "MSSQL_AGENT_ENABLED=true" #Включите агент SQL Server. Например «true» включен, и «false» отключена. По умолчанию агент отключен.
- "MSSQL_MASTER_DATA_FILE" #Задает расположение файла данных базы данных master.
- "MSSQL_ERROR_LOG_FILE" #Задает расположение файла журнала базы данных master.
- "MSSQL_MASTER_LOG_FILE" #Задает расположение файлов журнала ошибок.
POSTGRES_USER: zobor
POSTGRES_PASSWORD: 1234
volumes:
- ./database:/var/lib/postgresql/data
24 changes: 1 addition & 23 deletions docker/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
FROM ubuntu:latest

ARG HOST_UID=1000
ARG HOST_GID=1000
ARG HOST_USER=host-user
ARG HOST_GROUP=host-group

RUN apt-get update && apt-get install -y gpg wget curl
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
RUN mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
RUN sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list'
RUN wget -q https://packages.microsoft.com/config/ubuntu/19.04/prod.list
RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
RUN apt-get install -y apt-transport-https
RUN apt-get update

RUN apt-get update && apt-get install -y dotnet-sdk-2.2

RUN groupadd -g $HOST_GID $HOST_GROUP && groupadd sudonopswd && \
useradd -m -l -g $HOST_GROUP -u $HOST_UID $HOST_USER && \
usermod -aG sudo $HOST_USER && usermod -aG sudonopswd $HOST_USER

USER host-user
FROM mcr.microsoft.com/dotnet/core/sdk:2.2

WORKDIR /app

Expand Down
54 changes: 0 additions & 54 deletions docker/mssql/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions src/Modules/ORM/NHibernate.cfg.xml

This file was deleted.

3 changes: 2 additions & 1 deletion src/app.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="NHibernate" Version="5.2.5" />
<PackageReference Include="Npgsql" Version="4.0.7" />
<PackageReference Include="SqlServerCompact" Version="4.0.8854.1" />
</ItemGroup>

Expand All @@ -22,5 +23,5 @@
<Folder Include="Modules\ORM\Fixtures" />
<Folder Include="Tests" />
</ItemGroup>

</Project>
Loading

0 comments on commit 2a3b3a6

Please sign in to comment.