-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (105 loc) · 3.39 KB
/
docker-compose.yml
File metadata and controls
109 lines (105 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
###
# @bot-written
#
# WARNING AND NOTICE
# Any access, download, storage, and/or use of this source code is subject to the terms and conditions of the
# Full Software Licence as accepted by you before being granted access to this source code and other materials,
# the terms of which can be accessed on the Codebots website at https://codebots.com/full-software-licence. Any
# commercial use in contravention of the terms of the Full Software Licence may be pursued by Codebots through
# licence termination and further legal action, and be required to indemnify Codebots for any loss or damage,
# including interest and costs. You are deemed to have accepted the terms of the Full Software Licence on any
# access, download, storage, and/or use of this source code.
#
# BOT WARNING
# This file is bot-written.
# Any changes out side of "protected regions" will be lost next time the bot makes any changes.
###
# % protected region % [Customise your compose file here] off begin
version: '3.4'
services:
db:
image: postgres:11
environment:
POSTGRES_DB: codebots
POSTGRES_USER: codebots
POSTGRES_PASSWORD: bots
networks:
- bridge
volumes:
- postgres_data:/var/lib/postgresql/data
pgAdmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: codebots@example.com
PGADMIN_DEFAULT_PASSWORD: bots
PGADMIN_LISTEN_PORT: 9090
networks:
- bridge
ports:
- 9091:9090
client:
image: node:12-alpine
working_dir: /usr/src/app
command: sh -c "
yarn install;
HOST=0.0.0.0 yarn start;
tail -f /dev/null"
networks:
- bridge
volumes:
- ./clientside:/usr/src/app/
- node_modules:/usr/src/app/node_modules
healthcheck:
test: [ "CMD", "wget", "--spider", "http://localhost:3000" ]
interval: 60s
timeout: 2s
retries: 12
start_period: 60s
server:
image: mcr.microsoft.com/dotnet/sdk:5.0
working_dir: /usr/src/app/
command: bash -c 'bash -s <<EOF;
echo "Creating manifest...";
dotnet new tool-manifest;
dotnet tool install --local dotnet-ef --version 5.0.3;
mkdir -p Migrations;
MIGRATION=$$(date +"%s");
echo "Creating new migration $$MIGRATION...";
dotnet dotnet-ef migrations add $$MIGRATION;
MIGRATION_FILE="./Migrations/*_$$MIGRATION.cs";
if [ $$(grep -Pzoc "\{\n\s*\n\s*}" $$MIGRATION_FILE) -gt 0 ];
then echo "Migration not required, removing it...";
dotnet dotnet-ef migrations remove;
fi;
echo "Applying migrations...";
dotnet dotnet-ef database update;
echo "Launching server...";
dotnet run --launch-profile Docker;
tail -f /dev/null;
EOF'
environment:
ServerSettings__ServerUrl: http://0.0.0.0:5000
ConnectionStrings__DbConnectionString: Server=db;Database=codebots;Username=codebots;Password=bots
ClientServerSettings__UseProxyServer: "true"
ClientServerSettings__ProxyServerAddress: http://client:3000
networks:
- bridge
depends_on:
- db
- client
volumes:
- ./serverside/src:/usr/src/app
ports:
- 8000:5000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api"]
interval: 60s
timeout: 2s
retries: 12
start_period: 60s
networks:
bridge:
volumes:
node_modules:
postgres_data:
# % protected region % [Customise your compose file here] end