-
Notifications
You must be signed in to change notification settings - Fork 0
/
Commands.txt
237 lines (194 loc) · 5.76 KB
/
Commands.txt
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
python manage.py shell
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 127.0.0.1:8080
CONFIGURATION COMMANDS
- For running locally with Heroku:
python manage.py collectstatic
heroku local web -f Procfile.windows
- if collectstatic fails:
heroku config:set DEBUG_COLLECTSTATIC=1
### FOR PRODUCTION
PUSH TO HEROKU
git commit -am "comments"
git push heroku master
ou
git push heroku development-branch:master
- check in the Databases, "Sites"
- check Google and FB domains in their consoles
localtunnel
lt --port 8080 --subdomain reset-challenge-30d
acessoria.marcelasiqueira@gmail.com
moreira97
#Send Docker to AWS
## test (build das imagens de acordo com o Dockerfile)
docker-compose up -d --build
# Resultado sao duas imagens e um composto de dois containers rodando que funciona
docker-compose down
##Login
aws ecr get-login-password --region sa-east-1 | docker login --username AWS --password-stdin 322502383001.dkr.ecr.sa-east-1.amazonaws.com
##Tag imagens
docker tag reset-challenge:latest 322502383001.dkr.ecr.sa-east-1.amazonaws.com/reset-challenge
docker tag postgres:latest 322502383001.dkr.ecr.sa-east-1.amazonaws.com/postgres:latest
##Push docker image pro ECR
docker push 322502383001.dkr.ecr.sa-east-1.amazonaws.com/reset-challenge:latest
docker push 322502383001.dkr.ecr.sa-east-1.amazonaws.com/postgres:latest
# Contruir o JSON do Task Definition da mesma maneira que está o docker-compose (ta no fim desse arquivo)
# Basicamente esse Task é o q pega as imagens e define o comando do django pra abrir a porta
# Deploy pelo Custer/Service - define LoadBalancer (onde vai ta o endpoint)
# É onde se cria um servico longo, onde o task é executado e a porta exposta ao Loadbancer,
# com DNS publico
docker context create ecs --local-simulation ecsLocal
docker context use ecsLocal
docker compose up
## Context (changes where docker points the build, default is local)
docker context create ecs context-name (use access and secret keys, or profile)
docker compose up -c context-name
(aws ecr get-login-password --region sa-east-1) | docker login --password-stdin --username AWS 322502383001.dkr.ec
r.sa-east-1.amazonaws.com/ecsworker
docker compose up
JSON TASK DEFINITION
{
"ipcMode": null,
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": null,
"entryPoint": null,
"portMappings": [],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "POSTGRES_DB",
"value": "d70b90u9f6om4h"
},
{
"name": "POSTGRES_PASSWORD",
"value": "c8432332aaaf015c02045f817d923341c43b038035c6e57abe118a170a2fce59"
},
{
"name": "POSTGRES_USER",
"value": "kpxrkzhcjvwaca"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": 128,
"memoryReservation": null,
"volumesFrom": [],
"stopTimeout": null,
"image": "322502383001.dkr.ecr.sa-east-1.amazonaws.com/postgres:latest",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": false,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "DB"
},
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": null,
"entryPoint": null,
"portMappings": [
{
"hostPort": 8080,
"protocol": "tcp",
"containerPort": 80
}
],
"command": [],
"linuxParameters": null,
"cpu": 0,
"environment": [],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": 128,
"memoryReservation": null,
"volumesFrom": [],
"stopTimeout": null,
"image": "322502383001.dkr.ecr.sa-east-1.amazonaws.com/reset-challenge:latest",
"startTimeout": null,
"firelensConfiguration": null,
"dependsOn": [
{
"containerName": "DB",
"condition": "START"
}
],
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"systemControls": null,
"privileged": null,
"name": "RM"
}
],
"placementConstraints": [],
"memory": "300",
"taskRoleArn": null,
"compatibilities": [
"EC2"
],
"taskDefinitionArn": "arn:aws:ecs:sa-east-1:322502383001:task-definition/ResetMethod-task:13",
"family": "ResetMethod-task",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.ecr-auth"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "ecs.capability.container-ordering"
}
],
"pidMode": null,
"requiresCompatibilities": [
"EC2"
],
"networkMode": null,
"cpu": "200",
"revision": 13,
"status": "ACTIVE",
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
}