forked from bluesky/tiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request bluesky#382 from danielballan/no-gunicorn
Switch to single-process (uvicorn) container
- Loading branch information
Showing
24 changed files
with
217 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM node:16-alpine AS web_frontend_builder | ||
WORKDIR /code | ||
COPY web-frontend . | ||
RUN npm install && npm run build | ||
|
||
# We cannot upgrade to Python 3.11 until numba supports it. | ||
# The `sparse` library relies on numba. | ||
FROM python:3.10 as base | ||
WORKDIR /code | ||
|
||
# Ensure logs and error messages do not get stuck in a buffer. | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Use a venv to avoid interfering with system Python. | ||
ENV VIRTUAL_ENV=/opt/venv | ||
RUN python3 -m venv $VIRTUAL_ENV | ||
# This is equivalent to `source $VIRTUAL_ENV/bin/activate` but it | ||
# persists into the runtime so we avoid the need to account for it | ||
# in ENTRYPOINT or CMD. | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
# Copy requirements over first so this layer is cached and we don't have to | ||
# reinstall dependencies when only the tiled source has changed. | ||
COPY requirements-server.txt requirements-formats.txt requirements-dataframe.txt requirements-array.txt requirements-xarray.txt requirements-sparse.txt requirements-compression.txt /code/ | ||
RUN pip install --upgrade --no-cache-dir pip wheel | ||
RUN pip install --upgrade --no-cache-dir \ | ||
-r /code/requirements-array.txt \ | ||
-r /code/requirements-compression.txt \ | ||
-r /code/requirements-dataframe.txt \ | ||
-r /code/requirements-formats.txt \ | ||
-r /code/requirements-server.txt \ | ||
-r /code/requirements-sparse.txt \ | ||
-r /code/requirements-xarray.txt | ||
|
||
COPY --from=web_frontend_builder /code/build /code/share/tiled/ui | ||
COPY . . | ||
|
||
# note requirements listed here but all deps should be already satisfied | ||
RUN pip install '.[array, compression, dataframe, formats, server, sparse, xarray]' | ||
|
||
# FROM base as test | ||
# | ||
# RUN pip install '.[client]' | ||
# RUN pip install -r requirements-dev.txt | ||
# RUN pytest -v | ||
|
||
FROM base as app | ||
|
||
WORKDIR /deploy | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["tiled", "serve", "config", "--host", "0.0.0.0", "--port", "8000", "--scalable"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: "3.2" # higher config versions may also work; lower will not | ||
services: | ||
tiled: | ||
image: tiled | ||
volumes: | ||
- type: bind | ||
source: . | ||
target: /deploy | ||
environment: | ||
- TILED_CONFIG=/deploy/config.yml | ||
ports: | ||
- 8000:8000 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...r/test_configs/config_missing_api_key.yml → ...s/test_configs/config_missing_api_key.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...st_configs/config_missing_secret_keys.yml → ...st_configs/config_missing_secret_keys.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...igs/config_missing_secret_keys_public.yml → ...igs/config_missing_secret_keys_public.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...onfigs/config_public_no_authenticator.yml → ...onfigs/config_public_no_authenticator.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
docker/test_configs/config_with_api_key.yml → ...ests/test_configs/config_with_api_key.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
.../test_configs/config_with_secret_keys.yml → .../test_configs/config_with_secret_keys.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.