Skip to content

Commit

Permalink
makefile and compose improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SimHoZebs committed Aug 22, 2024
1 parent 81b5f09 commit 373cf8c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ yarn-error.log
.phpunit.result.cache
###< phpunit/phpunit ###

.env
*.env
10 changes: 10 additions & 0 deletions .ins.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TITLE=Your institution name
LMS_DOMAIN=myschool.instructure.com
LMS_ID=canvas
LMS_ACCOUNT_ID=1234567
CREATED=2021-06-08
STATUS=1
VANITY_URL=canvas.myschool.edu
METADATA={\"lang\":\"es\"}
API_CLIENT_ID=1234500000000001234
API_CLIENT_SECRET=your_api_client_secret
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ifneq (,$(wildcard ./.ins.env))
include .ins.env
export
endif

start:
docker compose -f docker-compose.nginx.yml up -d

migrate:
docker compose -f docker-compose.nginx.yml run php php bin/console doctrine:migrations:migrate

down:
docker compose -f docker-compose.nginx.yml down

ins-mysql:
docker exec -it udoit3-db mysql -u root -proot udoit3 -e "INSERT INTO institution (title, lms_domain, lms_id, lms_account_id, created, status, vanity_url, metadata, api_client_id, api_client_secret) VALUES ('$(TITLE)', '$(LMS_DOMAIN)', '$(LMS_ID)', '$(LMS_ACCOUNT_ID)', '$(CREATED)', '$(STATUS)', '$(VANITY_URL)', '$(METADATA)', '$(API_CLIENT_ID)', '$(API_CLIENT_SECRET)');"

ins-psql:
docker exec -it -e PGPASSWORD=root udoit3-db psql -U root -d udoit3 -w -c "INSERT INTO institution (title, lms_domain, lms_id, lms_account_id, created, status, vanity_url, metadata, api_client_id, api_client_secret) VALUES ('$(TITLE)', '$(LMS_DOMAIN)', '$(LMS_ID)', '$(LMS_ACCOUNT_ID)', '$(CREATED)', '$(STATUS)', '$(VANITY_URL)', '$(API_CLIENT_ID)', '$(API_CLIENT_SECRET)');"
8 changes: 6 additions & 2 deletions docker-compose.nginx.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.9"

services:
db:
container_name: udoit3-db
image: mysql:latest
volumes:
- dbdata:/var/lib/mysql
Expand All @@ -15,6 +14,7 @@ services:
# Uncomment this block and comment the next db block
# to use Postgres instead of MySQL
# db:
# container_name: udoit3-db
# image: postgres:alpine
# restart: always
# ports:
Expand All @@ -24,6 +24,7 @@ services:
# POSTGRES_PASSWORD: udoit
# POSTGRES_DB: udoit3
web:
container_name: udoit3-web
image: nginx:latest
ports:
- "8000:80"
Expand All @@ -35,6 +36,7 @@ services:
env_file:
- .env
php:
container_name: udoit3-php
build:
context: ./build/nginx
dockerfile: Dockerfile.php.pdo.mysql
Expand All @@ -46,6 +48,7 @@ services:
env_file:
- .env
composer:
container_name: udoit3-composer
build:
context: ./build/nginx
dockerfile: Dockerfile.composer
Expand All @@ -55,6 +58,7 @@ services:
env_file:
- .env
yarn:
container_name: udoit3-yarn
image: node:16
volumes:
- ./:/app
Expand Down

0 comments on commit 373cf8c

Please sign in to comment.