-
Notifications
You must be signed in to change notification settings - Fork 25
Pv/create docker image for deploy #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.8-slim | ||
|
||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN pip install --no-cache-dir ./stac_fastapi/elasticsearch[server] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only install server deps, not dev also |
||
|
||
EXPOSE 8080 | ||
|
||
CMD ["uvicorn", "stac_fastapi.elasticsearch.app:app", "--host", "0.0.0.0", "--port", "8080"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.8-slim | ||
|
||
|
||
# update apt pkgs, and install build-essential for ciso8601 | ||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get install -y build-essential && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# update certs used by Requests | ||
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN pip install --no-cache-dir -e ./stac_fastapi/elasticsearch[dev,server] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,24 @@ run_es = docker-compose \ | |
|
||
.PHONY: image | ||
image: | ||
docker build -f Dockerfile.deploy -t stac-fastapi-elasticsearch:latest . | ||
|
||
.PHONY: run | ||
run: | ||
docker run -it -p 8080:8080 \ | ||
-e ENVIRONMENT=local \ | ||
-e ES_HOST=docker.for.mac.localhost \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will have to be updated for non-mac. tbd. |
||
-e ES_PORT=9200 \ | ||
-e ES_USER=dev \ | ||
-e ES_PASS=stac \ | ||
stac-fastapi-elasticsearch:latest | ||
|
||
.PHONY: image-dev | ||
image-dev: | ||
docker-compose build | ||
|
||
.PHONY: docker-run | ||
docker-run: image | ||
docker-run: image-dev | ||
$(run_es) | ||
|
||
.PHONY: docker-shell | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
"elasticsearch-dsl==7.4.0", | ||
"pystac[validation]", | ||
"uvicorn", | ||
"overrides", | ||
] | ||
|
||
extra_reqs = { | ||
|
@@ -28,7 +29,6 @@ | |
"pre-commit", | ||
"requests", | ||
"ciso8601", | ||
"overrides", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should have been a core dep rather than an extra. We never ran it without also installing the dev deps, so it didn't surface. |
||
"httpx", | ||
], | ||
"docs": ["mkdocs", "mkdocs-material", "pdocs"], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,7 @@ async def test_app_fields_extension(load_test_data, app_client, txn_client): | |
resp_json = resp.json() | ||
assert list(resp_json["features"][0]["properties"]) == ["datetime"] | ||
|
||
txn_client.delete_item(item["id"], item["collection"], request=MockRequest) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this method doesn't use the request, so removing |
||
txn_client.delete_item(item["id"], item["collection"]) | ||
|
||
|
||
async def test_app_query_extension_gt(app_client, ctx): | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only dev dependencies need buildessitials and git, so don't install.