Skip to content

Commit

Permalink
Merge pull request #11 from sogno-platform/feature/test-environment
Browse files Browse the repository at this point in the history
Feature/test environment
  • Loading branch information
wquentind authored Nov 9, 2023
2 parents 249749d + da39462 commit 5e90f07
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Build
run: |
pip install build
python -m build --wheel --outdir dist
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand Down
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM python:3-slim as builder

COPY . /src
WORKDIR /src

RUN pip install build

RUN python -m build


FROM python:3-slim

COPY dist /dist
COPY --from=builder /src/dist /dist

RUN pip install --no-cache-dir --no-compile dist/*.whl

Expand Down
8 changes: 4 additions & 4 deletions test/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ services:
fileservice:
image: ghcr.io/sogno-platform/pgm-service/fileservice:main
build:
context: fileservice
context: test/fileservice
volumes:
- ../data:/data
- ./data:/data
environment:
DATA_DIR: "/data"
BASE_URL: "http://localhost:8080/"
BASE_URL: "http://fileservice:8080/"
ports:
- 8080:8080
worker:
image: ghcr.io/sogno-platform/pgm-service:main
build:
context: ..
context: .
environment:
FILESERVICE_URL: http://fileservice:8080/
ports:
Expand Down
2 changes: 1 addition & 1 deletion test/fileservice/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12
FROM python:3.10

RUN python -m pip install fastapi uvicorn && mkdir /data
COPY fileservice.py fileservice.py
Expand Down
2 changes: 1 addition & 1 deletion test/fileservice/fileservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def list_files() -> dict:


@app.post("/files/")
async def new_file(request: Request) -> dict | Response:
async def new_file(request: Request) -> dict:
try:
id = str(uuid.uuid4())
with open(os.path.join(DATA_DIR, id), 'wb') as file:
Expand Down

0 comments on commit 5e90f07

Please sign in to comment.