diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..43d3571 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +photod-backend +photod-frontend diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..89100c8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## v0.0.1 +Released 25 July 2017 + +Highlights: +* Initial preview release. + +The full list of commits can be found [here](https://github.com/basilfx/Photod/compare/b25a100326da1cfc2127e60f940c10f4ba6a34e7...v0.0.1). diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..325d9ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:17.04 + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y curl git apt-utils + +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y build-essential gdal-bin libavcodec-dev \ + libavdevice-dev libavfilter-dev libavformat-dev libavresample-dev \ + libavutil-dev libboost-python-dev libjpeg-dev libleptonica-dev \ + libsqlite3-mod-spatialite libswscale-dev libtesseract-dev nodejs \ + python3 python3-dev python3-pip python3-venv tesseract-ocr \ + tesseract-ocr-all && \ + npm install -g yarn + +RUN apt-get clean + +COPY docker/entry_point.sh /entry_point.sh + +ENTRYPOINT ["/entry_point.sh"] diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 0000000..ee64130 --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1,3 @@ +# Installation + +docker run -ti --rm --volume `pwd`:`pwd` -w `pwd` photod:latest backend-run diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..962f815 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) 2017 Bas Stottelaar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b91864b --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# Photod +An experimental photo gallery. + +## Installation + +Start the backend: + +```bash +``` + +Start the frontend: + +```bash +``` + + + +## Contributing +Feel free to submit a pull request. All pull requests must be made against the `development` branch. + +Python code should follow the PEP-8 conventions and the JavaScript code should comply with the included ESLint style rules. + +## License +See the `LICENSE.md` file (MIT license). diff --git a/TODO b/TODO deleted file mode 100644 index 0c44073..0000000 --- a/TODO +++ /dev/null @@ -1,6 +0,0 @@ -Add celery -select items - - - -classify colors -> remove GPL diff --git a/docker/entry_point.sh b/docker/entry_point.sh new file mode 100755 index 0000000..74ea2d5 --- /dev/null +++ b/docker/entry_point.sh @@ -0,0 +1,47 @@ +#!/bin/bash -e + +OPTION="$1" + +# Check if an option is specified. +if [[ -z $OPTION ]]; then + echo "Usage: $0 " + exit 0 +fi + +# This script must be run in the project root folder. +if [ ! -d "photod-backend" ]; then + echo "The source directory is not mounted." + exit 1 +fi + +# Parse option and execute action. +case $OPTION in + backend-init) + (cd photod-frontend && source env/bin/activate && pip install -r requirements.txt) + ;; + backend-run) + (cd photod-backend && source env/bin/activate && ./manage.py runserver 0:7000) + ;; + backend-shell) + (cd photod-backend && source env/bin/activate && ./manage.py shell_plus) + ;; + backend-migrate) + (cd photod-backend && source env/bin/activate && ./manage.py migrate) + ;; + frontend-init) + (cd photod-frontend && yarn) + ;; + frontend-run) + (cd photod-frontend && yarn run start) + ;; + frontend-build) + (cd photod-frontend && yarn run build-production) + ;; + *) + echo "Unknown option: $OPTION" + exit 1 + ;; +esac + +# Exit successfully. +exit 0