Skip to content

Commit 04a418f

Browse files
committed
Crate initial API keys & sample entries
1 parent 1415d8b commit 04a418f

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

docker-compose.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ version: '3'
33
services:
44
db:
55
image: mysql:5
6+
volumes:
7+
- coc_api_dbdata:/var/lib/mysql
8+
- ./seed.sh:/usr/local/bin/seed.sh
69
environment:
7-
MYSQL_ROOT_PASSWORD: 123456
10+
MYSQL_ROOT_PASSWORD: clockofchangepw
811
MYSQL_DATABASE: clock_of_change
12+
MYSQL_USER: coc
13+
MYSQL_PASSWORD: 123456
914
ports:
10-
- 3306:3306
15+
- 3306:3306
1116

1217
mailhog:
1318
container_name: mailhog
@@ -21,14 +26,14 @@ services:
2126
build:
2227
context: .
2328
volumes:
24-
- ".:/home/node/coc-api"
25-
- "/home/node/coc-api/node_modules"
29+
- .:/home/node/coc-api
30+
- /home/node/coc-api/node_modules
2631
ports:
2732
- 1337:1337
2833
environment:
2934
- MYSQL_HOST=db
3035
- MYSQL_DB=clock_of_change
31-
- MYSQL_USER=root
36+
- MYSQL_USER=coc
3237
- MYSQL_PASS=123456
3338
- MAIL_HOST=mailhog
3439
- MAIL_PORT=1025
@@ -38,3 +43,6 @@ services:
3843
- db
3944
- mailhog
4045
command: bash -c "wait-on tcp:db:3306 && db-migrate up && npm run start"
46+
47+
volumes:
48+
coc_api_dbdata:

seed.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
mysql --user=$MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DATABASE << EOF
3+
INSERT INTO \`clock_of_change\`.\`apikeys\` (\`secret\`, \`valid\`) VALUES ('secret', '1');
4+
INSERT INTO \`clock_of_change\`.\`entries\` (\`firstname\`, \`lastname\`, \`email\`, \`country\`, \`message\`, \`confirm_key\`, \`beta\`, \`newsletter\`, \`pax\`, \`email_confirmed\`, \`status\`) VALUES ('Pamela', 'Musterfrau', 'pamela@musterfrau.com', 'US', 'Let us change the world!', 'confirm', '1', '0', '1', '1', '1');
5+
INSERT INTO \`clock_of_change\`.\`entries\` (\`firstname\`, \`lastname\`, \`email\`, \`country\`, \`message\`, \`confirm_key\`, \`beta\`, \`newsletter\`, \`pax\`, \`email_confirmed\`, \`status\`) VALUES ('Max', 'Mustermann', 'max@mustermann.de', 'DE', 'Lasst uns die Welt verbessern!', 'confirm', '0', '1', '1', '1', '1');
6+
EOF

0 commit comments

Comments
 (0)