Skip to content

Commit 2983544

Browse files
committed
docker deployment
1 parent 6d83d4b commit 2983544

3 files changed

Lines changed: 46 additions & 14 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'docker-v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Extract version from tag
18+
id: meta
19+
run: |
20+
if [[ "$GITHUB_REF" == refs/tags/docker-v* ]]; then
21+
VERSION="${GITHUB_REF#refs/tags/docker-v}"
22+
echo "tags=afriedman412/petey:${VERSION},afriedman412/petey:latest" >> "$GITHUB_OUTPUT"
23+
else
24+
echo "tags=afriedman412/petey:latest" >> "$GITHUB_OUTPUT"
25+
fi
26+
27+
- uses: docker/setup-buildx-action@v3
28+
29+
- uses: docker/login-action@v3
30+
with:
31+
username: afriedman412
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- uses: docker/build-push-action@v6
35+
with:
36+
context: .
37+
file: Dockerfile.standalone
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
platforms: linux/amd64,linux/arm64
41+
cache-from: type=gha
42+
cache-to: type=gha,mode=max

Dockerfile.standalone

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ COPY schemas/ schemas/
2020

2121
RUN pip install --no-cache-dir .
2222

23-
# Default to self-hosted mode: no auth, no page limit
23+
# Default to self-hosted mode: no auth, no page limit, local parsing
2424
ENV FIREBASE_AUTH_DISABLED=1
2525
ENV MAX_PAGES=0
26-
ENV PARSER_URL=http://parser:8081
26+
ENV PARSER_URL=
2727

2828
EXPOSE 8080
2929
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8080"]

docker-compose.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
services:
22
petey:
3-
build:
4-
context: .
5-
dockerfile: Dockerfile.standalone
3+
image: afriedman412/petey:latest
64
ports:
75
- "8080:8080"
86
environment:
97
- FIREBASE_AUTH_DISABLED=1
108
- MAX_PAGES=0
11-
- PARSER_URL=http://parser:8081
12-
depends_on:
13-
- parser
14-
15-
parser:
16-
build:
17-
context: ./parser
18-
expose:
19-
- "8081"
9+
- PARSER_URL=

0 commit comments

Comments
 (0)