generated from n0rdlicht/wagtail-headless-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (40 loc) · 2.09 KB
/
Makefile
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
.PHONY: build
SHELL := /bin/bash
IMAGENAME=deepurbanism-cms
VERSION=0.1.7
GH_ORG=cividi
APPLIED_VERSION=0.1.7
build: ## Build the Docker images
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/$(GH_ORG)/$(IMAGENAME):latest -t ghcr.io/$(GH_ORG)/$(IMAGENAME):$(VERSION) --push ./django
# docker-compose -p wagtail_grapple build
build-staging:
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/$(GH_ORG)/$(IMAGENAME):latest --push ./django
build-dev:
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/$(GH_ORG)/$(IMAGENAME):dev --push --build-arg ENVIRONMENT=dev ./django
# docker-compose -p wagtail_grapple build
build-dev-local:
docker buildx build --platform linux/arm64 -t ghcr.io/$(GH_ORG)/$(IMAGENAME):dev --load --build-arg ENVIRONMENT=dev ./django
up: ## Bring the Docker containers up
docker-compose up -d --no-build || echo 'Already up!'
upwin: ## Bring the Docker container up for bash on ubuntu folk
export WINDIR="$(subst /mnt/c,//c,$(CURDIR))/" && make up
lint: build ## Lint the python code.
docker run -v $(CURDIR)/django:/app $(IMAGENAME) /bin/bash -c 'flake8 website'
down: ## Stop the backend Docker container
docker-compose -p wagtail_grapple stop
enter: ## Enter backend container
docker exec -it wagtail_grapple_backend_1 /bin/bash
clean: ## Stop and remove all Docker containers
docker-compose down
destroy: ## Remove all our Docker images
docker rmi -f ghcr.io/cividi/wagtail_grapple:dev
refresh: clean up enter
## Let's start again
run:
docker run -it --rm --env-file ${ENV} ghcr.io/$(GH_ORG)/$(IMAGENAME):$(APPLIED_VERSION) /bin/bash
migrate:
docker run --rm --env-file ${ENV} ghcr.io/$(GH_ORG)/$(IMAGENAME):$(APPLIED_VERSION) sh -c "cd wagtail_vue && python manage.py makemigrations && python manage.py migrate"
createsuperuser:
docker run -it --rm --env-file ${ENV} ghcr.io/$(GH_ORG)/$(IMAGENAME):$(APPLIED_VERSION) sh -c "cd wagtail_vue && python manage.py createsuperuser"
init:
docker run --rm --env-file ${ENV} ghcr.io/$(GH_ORG)/$(IMAGENAME):$(APPLIED_VERSION) sh -c "cd wagtail_vue && python manage.py collectstatic --noinput"