Skip to content

Commit

Permalink
fix(docker): fix Docker build and update dev instructions for running…
Browse files Browse the repository at this point in the history
… image locally (#353)
  • Loading branch information
Shillaker authored Dec 12, 2024
1 parent c5f0522 commit ef7d3e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

COPY --from=build-env /app /app
COPY --from=build-env /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
ENV PYTHONPATH=/usr/local/lib/python3.9/site-packages
COPY --from=build-env /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
ENV PYTHONPATH=/usr/local/lib/python3.12/site-packages

WORKDIR /app

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CURRENT_VERSION := $(shell poetry version -s || sed -n '3s/.*version = "\(.*\)"/\1/p' pyproject.toml)
TIMESTAMP := $(shell date "+%H.%M-%m-%d-%y")
TIMESTAMP := $(shell date "+%m-%d-%y")
DOCKER_NAME := boavizta/boaviztapi:${CURRENT_VERSION}
SEMVERS := major minor patch

Expand Down Expand Up @@ -64,3 +64,6 @@ docker-build:

docker-build-development:
docker build -t boavizta/boaviztapi:${TIMESTAMP} . --build-arg VERSION=${TIMESTAMP}

docker-run-development:
docker run -p 5000:5000 boavizta/boaviztapi:${TIMESTAMP}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,15 @@ docker build --build-arg VERSION=`poetry version -s` .
Run Docker image:

```sh
docker run -p 5000:5000/tcp boavizta/boaviztapi:latest
docker run -p 5000:5000/tcp boavizta/boaviztapi:`poetry version -s`
```

#### Alternative (if you don't have Python or Poetry)

```sh
make docker-build-development

make docker-run-development
```

### Deploy to AWS as serverless application
Expand Down

0 comments on commit ef7d3e0

Please sign in to comment.