Skip to content

Commit

Permalink
remove frontend code
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Sep 2, 2024
1 parent b23cad3 commit 9cbe315
Show file tree
Hide file tree
Showing 40 changed files with 179 additions and 5,993 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
matrix:
include:
- context: .
image: ghcr.io/${{ github.repository }}-nginx
- context: ./titiler
image: ghcr.io/${{ github.repository }}-titiler

permissions:
Expand Down
185 changes: 160 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,162 @@
datasets/*/
!datasets/example-*
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Logs
logs
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml

This file was deleted.

31 changes: 17 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM node:18 as frontend
FROM registry.opensuse.org/opensuse/leap:latest as base
RUN --mount=type=cache,target=/var/cache/zypper \
zypper install --no-recommends -y python311 opencv libgthread-2_0-0
WORKDIR /app
COPY package.json package-lock.json .
RUN npm i
COPY src src/
COPY public public/
COPY vite.config.js index.html .
ENV PYTHONPATH=/app/.venv/lib
ENV PATH=$PATH:/app/.venv/bin

CMD ["npm", "run", "dev"]
FROM base as pdm
RUN --mount=type=cache,target=/var/cache/zypper \
zypper install --no-recommends -y python311-pip git
RUN python3.11 -m pip install pdm
COPY ./pyproject.toml ./pdm.lock .
# RUN --mount=type=cache,target=/var/cache/zypper \
# zypper install --no-recommends -y gdal-devel gcc gcc-c++ python311-devel
RUN pdm install --prod
# RUN pdm add gdal==$(rpm -q --queryformat='%{VERSION}' gdal)

FROM frontend as build
RUN npm run build

FROM nginx

COPY nginx/default.conf.template /etc/nginx/templates/
COPY --from=build /app/dist /var/www/
FROM pdm
COPY src src
CMD ["pdm", "run", "uvicorn", "src.app.app:app", "--host", "0.0.0.0", "--port", "8080"]
2 changes: 0 additions & 2 deletions data/.gitignore

This file was deleted.

44 changes: 2 additions & 42 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,18 @@
x-common-nginx:
&common-nginx
ports:
- 8001:80

services:
nginx:
<<: *common-nginx
profiles:
- prod
build: .
volumes:
- ./data:/var/www/data:ro
nginx-dev:
<<: *common-nginx
profiles:
- dev
image: nginx
volumes:
- ./data:/var/www/data:ro
- ./nginx/dev.conf.template:/etc/nginx/templates/default.conf.template:ro

vite:
build:
target: frontend
volumes:
- ./src:/app/src
- ./config.js:/app/public/config.js
ports:
- "3000:3000"
profiles:
- dev

titiler:
build: ./titiler
build: .
tty: true
stdin_open: true
ports:
- "5002:8080"
volumes:
- ./titiler/src:/app/src
- ./src:/app/src
environment:
- TITILER_API_ROOT_PATH=/tiler
- TITILER_API_CACHECONTROL=no-cache
- REDIS_HOST=redis
command: ["pdm", "run", "uvicorn", "src.app.app:app", "--host", "0.0.0.0", "--port", "8080", "--reload"]

jupyter:
build: ./titiler
command: jupyter notebook --allow-root --ip 0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.password=''
ports:
- 8888:8888
volumes:
- ./titiler/src:/app/src

redis:
image: redis

13 changes: 0 additions & 13 deletions index.html

This file was deleted.

23 changes: 0 additions & 23 deletions nginx/default.conf.template

This file was deleted.

27 changes: 0 additions & 27 deletions nginx/dev.conf.template

This file was deleted.

Loading

0 comments on commit 9cbe315

Please sign in to comment.