Skip to content

Commit

Permalink
move docker from root to example dir
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverlambson committed Aug 24, 2024
1 parent 7206653 commit 3b3ef42
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 48 deletions.
32 changes: 0 additions & 32 deletions Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@ fmt:
uv run mdformat README.md
npx prettier . --write

.PHONY: dev
## Run locally
dev:
UVICORN_RELOAD=true uv run bc-example

.PHONY: d.up
## Start docker compose
d.up:
docker compose up --build

.PHONY: d.down
## Stop docker compose
d.down:
docker compose down --remove-orphans

.PHONY: clean
## Remove all hidden generated/cache files
clean:
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions examples/full/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.12-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv

RUN useradd --uid 1001 --user-group --home-dir=/home/bored-charts --create-home --shell=/bin/false bored-charts
USER bored-charts

COPY --chown=bored-charts pyproject.toml /app/pyproject.toml
RUN chown bored-charts:bored-charts /app

WORKDIR /app
RUN uv sync --no-install-project --no-install-workspace --no-dev --compile-bytecode

COPY --chown=bored-charts . /app
WORKDIR /app

RUN uv sync

ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1
EXPOSE 4000
CMD ["bc-example"]
HEALTHCHECK CMD ["curl", "--fail", "http://localhost:4000/healthz"]
14 changes: 14 additions & 0 deletions examples/full/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: dev
## Run locally
dev:
UVICORN_RELOAD=true uv run bc-example

.PHONY: up
## Start docker compose
up:
docker compose up --build

.PHONY: down
## Stop docker compose
down:
docker compose down --remove-orphans
6 changes: 6 additions & 0 deletions examples/full/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ Project structure:
├── README.md
└── pyproject.toml
```

It's also dockerized:

```bash
docker compose up --build
```
File renamed without changes.
13 changes: 12 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b3ef42

Please sign in to comment.