-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
60 lines (51 loc) · 1.69 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
58
59
60
PORT = 8484
TEAM = cool-beans
# Possible bases: gristlabs/grist, or gristlabs/grist-ee
BASE = gristlabs/grist
IMAGE = $(BASE)-omnibus
build:
docker build --build-arg BASE=$(BASE) -t $(IMAGE) .
run:
mkdir -p /tmp/omnibus
docker run --rm --name grist \
-e URL=http://localhost:$(PORT) \
-v /tmp/omnibus:/persist \
-e [email protected] \
-e PASSWORD=topsecret \
-e TEAM=$(TEAM) \
-p $(PORT):80 \
-it $(IMAGE)
push:
docker push $(IMAGE)
buildwitharch:
DOCKER_BUILDKIT=1 docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BASE=$(BASE) \
-t $(IMAGE) .
DOCKER_BUILDKIT=1 docker buildx build \
--build-arg BASE=$(BASE) \
-t $(IMAGE) --load .
pushwitharch:
DOCKER_BUILDKIT=1 docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BASE=$(BASE) \
-t $(IMAGE) --push .
test:
./.github/test.sh
makecert:
@echo "Put grist.example.com in your /etc/hosts as 127.0.0.1, and make a self-signed cert for it"
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes
runwithcert:
mkdir -p /tmp/omnibus
docker run --rm --name grist \
-e URL=https://grist.example.com:$(PORT) \
-e HTTPS=manual \
-v $(PWD)/key.pem:/custom/grist.key \
-v $(PWD)/cert.pem:/custom/grist.crt \
-v /tmp/omnibus:/persist \
-e [email protected] \
-e PASSWORD=topsecret \
-e TEAM=$(TEAM) \
-p $(PORT):443 \
--add-host grist.example.com:$(shell docker network inspect --format='{{range .IPAM.Config}}{{.Gateway}}{{end}}' bridge) \
-it $(IMAGE)