-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
61 lines (51 loc) · 2.24 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
61
SHELL=/bin/bash
DOCKER_NETWORK ?= legisdata
.PHONY: dev cert database migrate caddy backend frontend docker-migrate search-node search-dashboard
dev: database caddy frontend backend search-node
cert:
bash ./scripts/cert-generator.sh
database:
podman run \
--rm --replace \
--name=legisdata_database \
--publish=0.0.0.0:5432:5432 \
--env-file=.env \
--network ${DOCKER_NETWORK} \
postgres:16
migrate:
poetry run python manage.py migrate && \
poetry run python manage.py import-legisdata 2020 2 && \
poetry run python manage.py opensearch index rebuild --force && \
poetry run python manage.py opensearch document index --force
frontend:
(FORCE_COLOR=1 BROWSER=none yarn run dev | cat)
backend:
poetry run gunicorn legisweb.wsgi:application --reload --bind=0.0.0.0:8000
caddy:
caddy run
search-node:
podman run \
--rm --replace \
--name=search-node \
--publish 9200:9200 \
--publish 9600:9600 \
--env "discovery.type=single-node" \
--env-file=.env \
--network ${DOCKER_NETWORK} \
--mount type=bind,source="$(shell pwd)/podman/opensearch/usr/share/opensearch/config/opensearch-dev.yml",target=/usr/share/opensearch/config/opensearch.yml \
--mount type=bind,source="$(shell pwd)/podman/opensearch/usr/share/opensearch/config/opensearch-security/internal_users.yml",target=/usr/share/opensearch/config/opensearch-security/internal_users.yml \
--mount type=bind,source="$(shell pwd)/certificates/root/root-ca.pem",target=/usr/share/opensearch/config/root-ca.pem \
--mount type=bind,source="$(shell pwd)/certificates/admin/admin.pem",target=/usr/share/opensearch/config/admin.pem \
--mount type=bind,source="$(shell pwd)/certificates/admin/admin-key.pem",target=/usr/share/opensearch/config/admin-key.pem \
--mount type=bind,source="$(shell pwd)/certificates/dev/dev.pem",target=/usr/share/opensearch/config/node.pem \
--mount type=bind,source="$(shell pwd)/certificates/dev/dev-key.pem",target=/usr/share/opensearch/config/node-key.pem \
opensearchproject/opensearch:latest
search-dashboard:
podman run \
--rm --replace \
--name=search-dashboard \
--publish 5601:5601 \
--env 'OPENSEARCH_HOSTS=["https://search-node:9200/"]' \
--env-file=.env \
--network ${DOCKER_NETWORK} \
opensearchproject/opensearch-dashboards:2.11.1