Skip to content

Commit b0e25cd

Browse files
committed
Initial commit
1 parent 4d7ce9d commit b0e25cd

23 files changed

+1238
-0
lines changed

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

db/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM mcr.microsoft.com/mssql/server:2019-CU13-ubuntu-20.04
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY create-databases.sql /usr/src/app/create-databases.sql
6+
COPY initdbs.sh /usr/src/app/initdbs.sh
7+
COPY entrypoint.sh /usr/src/app/entrypoint.sh
8+
9+
EXPOSE 1433
10+
11+
CMD /bin/bash ./entrypoint.sh

db/create-databases.sql

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'Resgrid')
2+
BEGIN
3+
CREATE DATABASE Resgrid;
4+
END
5+
GO
6+
7+
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'ResgridWorkers')
8+
BEGIN
9+
CREATE DATABASE ResgridWorkers;
10+
END
11+
GO
12+
13+
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'ResgridOIDC')
14+
BEGIN
15+
CREATE DATABASE ResgridOIDC;
16+
END
17+
GO

db/entrypoint.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/src/app/initdbs.sh & /opt/mssql/bin/sqlservr

db/initdbs.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sleep 90s
2+
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Resgrid123!! -d master -i create-databases.sql

db/run-initialization.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Wait to be sure that SQL Server came up
2+
sleep 90s
3+
4+
# Run the setup script to create the DB and the schema in the DB
5+
# Note: make sure that your password matches what is in the Dockerfile
6+
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P Resgrid123! -d master -i create-database.sql

docker-compose.dcproj

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|AnyCPU">
5+
<Configuration>Debug</Configuration>
6+
<Platform>AnyCPU</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Docker|AnyCPU">
9+
<Configuration>Docker</Configuration>
10+
<Platform>AnyCPU</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|AnyCPU">
13+
<Configuration>Release</Configuration>
14+
<Platform>AnyCPU</Platform>
15+
</ProjectConfiguration>
16+
</ItemGroup>
17+
<PropertyGroup Label="Globals">
18+
<ProjectVersion>2.1</ProjectVersion>
19+
<DockerTargetOS>Linux</DockerTargetOS>
20+
<ProjectGuid>5f012a17-ecc0-42fe-b270-5ac1886610e8</ProjectGuid>
21+
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
22+
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/</DockerServiceUrl>
23+
<DockerServiceName>resgrid.webcore</DockerServiceName>
24+
</PropertyGroup>
25+
<ItemGroup>
26+
<None Include="mailserver.env" />
27+
<None Include="data\Dockerfile" />
28+
<None Include="data\create-databases.sql" />
29+
<None Include="data\run-initialization.sh" />
30+
<None Include="data\entrypoint.sh" />
31+
<None Include="docker-compose.yml" />
32+
<None Include=".dockerignore" />
33+
<None Include="resgrid.env" />
34+
</ItemGroup>
35+
</Project>

docker-compose.yml

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
version: '3.9'
2+
3+
services:
4+
web:
5+
image: "resgridllc/resgridwebcore:0.6.70"
6+
ports:
7+
- "5151:80"
8+
env_file:
9+
- resgrid.env
10+
restart: always
11+
networks:
12+
- rgmain:
13+
ipv4_address: 172.16.193.51
14+
depends_on:
15+
- api
16+
- events
17+
- db
18+
- redis
19+
- rabbitmq
20+
- worker
21+
- mongodb
22+
environment:
23+
- WAIT_HOSTS=db:1433,redis:6379,rabbitmq:15672,api:80,mongodb:27017
24+
- WAIT_TIMEOUT=300
25+
26+
api:
27+
image: "resgridllc/resgridwebservices:0.6.70"
28+
ports:
29+
- "5152:80"
30+
env_file:
31+
- resgrid.env
32+
restart: always
33+
networks:
34+
- rgmain:
35+
ipv4_address: 172.16.193.52
36+
depends_on:
37+
- events
38+
- db
39+
- redis
40+
- rabbitmq
41+
- worker
42+
- mongodb
43+
environment:
44+
- WAIT_HOSTS=db:1433,redis:6379,rabbitmq:15672,events:80,mongodb:27017
45+
- WAIT_TIMEOUT=300
46+
47+
events:
48+
image: "resgridllc/resgridwebevents:0.6.70"
49+
ports:
50+
- "5153:80"
51+
env_file:
52+
- resgrid.env
53+
restart: always
54+
networks:
55+
- rgmain:
56+
ipv4_address: 172.16.193.53
57+
depends_on:
58+
- db
59+
- redis
60+
- rabbitmq
61+
environment:
62+
- WAIT_HOSTS=db:1433,redis:6379,rabbitmq:15672
63+
- WAIT_AFTER=120
64+
- WAIT_TIMEOUT=300
65+
66+
worker:
67+
image: "resgridllc/resgridworkersconsole:0.6.70"
68+
env_file:
69+
- resgrid.env
70+
restart: always
71+
networks:
72+
- rgmain:
73+
ipv4_address: 172.16.193.54
74+
depends_on:
75+
- db
76+
- redis
77+
- rabbitmq
78+
- mongodb
79+
environment:
80+
- WAIT_HOSTS=db:1433,redis:6379,rabbitmq:15672,mongodb:27017
81+
- WAIT_AFTER=90
82+
- WAIT_TIMEOUT=180
83+
84+
db:
85+
ports:
86+
- "5157:1433"
87+
networks:
88+
- rgmain:
89+
ipv4_address: 172.16.193.55
90+
build: ./db
91+
environment:
92+
- SA_PASSWORD=Resgrid123!!
93+
- ACCEPT_EULA=Y
94+
- MSSQL_PID=Express
95+
volumes:
96+
- type: bind
97+
source: ./docker-data/sql/data
98+
target: /var/opt/mssql/data
99+
- type: bind
100+
source: ./docker-data/sql/log
101+
target: /var/opt/mssql/log
102+
- type: bind
103+
source: ./docker-data/sql/backup
104+
target: /var/opt/mssql/backup
105+
106+
redis:
107+
image: "redis:alpine"
108+
command: redis-server --save 60 1 --loglevel warning
109+
ports:
110+
- "5158:6379"
111+
restart: always
112+
networks:
113+
- rgmain:
114+
ipv4_address: 172.16.193.56
115+
116+
rabbitmq:
117+
image: rabbitmq:3-management
118+
environment:
119+
- RABBITMQ_DEFAULT_USER=resgrid
120+
- RABBITMQ_DEFAULT_PASS=Resgrid321!
121+
ports:
122+
- "5160:15672"
123+
- "5159:5672"
124+
restart: always
125+
networks:
126+
- rgmain:
127+
ipv4_address: 172.16.193.57
128+
129+
elk:
130+
image: sebp/elk
131+
ports:
132+
- "5163:5601"
133+
- "5164:9200"
134+
- "5165:5044"
135+
restart: always
136+
networks:
137+
- rgmain:
138+
ipv4_address: 172.16.193.58
139+
140+
mongodb:
141+
image: mongo:4.4.18
142+
ports:
143+
- 27017:27017
144+
restart: always
145+
networks:
146+
- rgmain:
147+
ipv4_address: 172.16.193.59
148+
environment:
149+
- MONGO_INITDB_DATABASE=resgrid
150+
- MONGO_INITDB_ROOT_USERNAME=resgridUser
151+
- MONGO_INITDB_ROOT_PASSWORD=Resgrid123!!
152+
volumes:
153+
- ./mongo-entrypoint:/docker-entrypoint-initdb.d
154+
- ./docker-data/mongo/db:/data/configdb
155+
- ./docker-data/mongo/configdb:/data/db
156+
157+
nginx:
158+
image: nginx:1.15-alpine
159+
restart: unless-stopped
160+
volumes:
161+
- ./docker-data/nginx:/etc/nginx/conf.d
162+
- ./docker-data/certbot/conf:/etc/letsencrypt
163+
- ./docker-data/certbot/www:/var/www/certbot
164+
ports:
165+
- "80:80"
166+
- "443:443"
167+
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
168+
certbot:
169+
image: certbot/certbot
170+
restart: unless-stopped
171+
volumes:
172+
- ./docker-data/certbot/conf:/etc/letsencrypt
173+
- ./docker-data/certbot/www:/var/www/certbot
174+
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
175+
176+
networks:
177+
rgmain:
178+
ipam:
179+
driver: default
180+
config:
181+
- subnet: 172.16.193.0/24

docker-data/certbot/certbot

Whitespace-only changes.

docker-data/dms/config/mailconfig

Whitespace-only changes.

docker-data/dms/mail-data/maildata

Whitespace-only changes.

docker-data/dms/mail-logs/maillogs

Whitespace-only changes.

docker-data/dms/mail-state/mailstate

Whitespace-only changes.

docker-data/mongo/configdb/configdb

Whitespace-only changes.

docker-data/mongo/db/db

Whitespace-only changes.

0 commit comments

Comments
 (0)