-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dev docker and instruction to watch file changes and update on th…
…e fly
- Loading branch information
Showing
6 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,6 @@ | |
|
||
# test script | ||
test.sh | ||
|
||
.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM python:3.10.0-alpine | ||
|
||
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple | ||
RUN pip install --upgrade pip | ||
RUN pip install mkdocs-material==9.5.5 mkdocs-glightbox | ||
|
||
WORKDIR /hello-algo | ||
|
||
EXPOSE 8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
VERBOSE=--verbose | ||
|
||
all: # do nothing by default | ||
@echo "usage: make [build-docker|run-dev|dev|stop|sh]" | ||
|
||
build-docker: # build dev container | ||
# docker build -t hello-algo-dev -f Dockerfile-dev . | ||
docker compose -f docker-compose-dev.yml build | ||
|
||
buildx-docker: | ||
docker build -t hello-algo-dev -f Dockerfile-dev . --load | ||
|
||
run-dev: # run in background | ||
docker compose -f docker-compose-dev.yml up -d | ||
|
||
dev: # run dev container | ||
docker compose -f docker-compose-dev.yml $(VERBOSE) up | ||
|
||
stop: # stop dev container | ||
docker compose -f docker-compose-dev.yml down | ||
|
||
sh: # go to dev container shell | ||
docker exec -it hello-algo-dev sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
services: | ||
hello-algo-dev: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-dev | ||
image: hello-algo-dev | ||
container_name: hello-algo-dev | ||
ports: | ||
- "${HTTP_PORT:-8000}:8000" | ||
# tty: true | ||
# stdin_open: true | ||
entrypoint: | ||
# - "/bin/sh" | ||
- mkdocs | ||
- serve | ||
- -a | ||
- 0.0.0.0:8000 | ||
volumes: | ||
- ./:/hello-algo | ||
- ./docs:/hello-algo/build/docs | ||
- ./overrides:/hello-algo/build/overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters