-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (37 loc) · 1.04 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
SHELL=/usr/bin/env bash
BASEDIR = $(shell pwd)
.PHONY:build
build:
docker buildx bake -f docker/docker-bake.hcl
.PHONY:inspect
inspect:
docker compose exec jupyter /bin/bash
.PHONY:down
down:
docker compose down
.PHONY:start # called `start` instead of `up` because it does more than `docker compose up`
start:
docker compose pull;
docker compose up -d --build --remove-orphans;
docker compose logs -f jupyter || true;
.PHONY:logs
logs:
docker compose logs -f jupyter || true;
.PHONY:dev
dev:
if [[ "$$(docker compose ps | grep 'jupyter')" == "" ]]; then \
docker compose pull; \
docker compose up -d --build && \
(sleep 1; python -m webbrowser "http://localhost:8888"); \
docker compose logs -f jupyter || true; \
else \
docker compose down jupyter && \
docker compose up -d jupyter && \
(sleep 1; python -m webbrowser "http://localhost:8888"); \
docker compose logs -f jupyter || true; \
fi
.env:
@if [[ ! -e ./.env ]]; then \
cp env.example .env; \
echo "Don't forget to set your OPENAI key in the .env file!"; \
fi