Skip to content

Commit

Permalink
Restructure repository, add support for Docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
basilfx committed Jul 25, 2017
1 parent 374d6e5 commit 804d78c
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
photod-backend
photod-frontend
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 3 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Installation

docker run -ti --rm --volume `pwd`:`pwd` -w `pwd` photod:latest backend-run
19 changes: 19 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
6 changes: 0 additions & 6 deletions TODO

This file was deleted.

47 changes: 47 additions & 0 deletions docker/entry_point.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash -e

OPTION="$1"

# Check if an option is specified.
if [[ -z $OPTION ]]; then
echo "Usage: $0 <backend-[init|run|migrate]|frontend-[init|run|build]>"
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

0 comments on commit 804d78c

Please sign in to comment.