Giter Site home page Giter Site logo

codefriendly / docker-pinry Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pinry/docker-pinry

0.0 3.0 0.0 22 KB

An easy way to get a Pinry instance up and running using Docker.

Home Page: http://getpinry.com/

License: Other

Nginx 15.00% Python 58.14% Shell 26.86%

docker-pinry's Introduction

docker-pinry

A nice and easy way to get a pinry instance up and running using docker. For help on getting started with docker see the official getting started guide. For more information on Pinry and a demo check out it's website.

Getting docker-pinry

Running this will get the latest version of both docker-pinry and pinry itself:

git clone https://github.com/pinry/docker-pinry
cd docker-pinry

Configuring docker-pinry

Enable signups for new users by editing pinry/settings/__init__.py:

ALLOW_NEW_REGISTRATIONS = True

Additional pinry configuration settings

Building docker-pinry

Running this will build you a docker image with the latest version of both docker-pinry and pinry itself:

sudo docker build -t pinry/pinry .

Running docker-pinry

Running the start command for the first time will setup your production secret key, database and static files. It is important that you decide what port you want and what location on the host machine you wish to store your files. If this is the only thing running on your system and you wish to make it public without a proxy then you can set -p=80:80. The setting -p=10000:80 assumes you are wanting to proxy to this instance using something like nginx. Also note that you must have your host mount directory created first (mkdir -p /mnt/pinry):

sudo docker run -d=true -p=10000:80 -v=/mnt/pinry:/data pinry/pinry /start

If it's the first run it'll take a few seconds but it will print out your container ID which should be used to start and stop the container in the future using the commands:

sudo docker start <container_id>
sudo docker stop <container_id>

Notes on the run commands

  • -v is the volume you are mounting -v=host_dir:docker_dir
  • pinry/pinry is simply what I called my docker build of this image
  • -d=true allows this to run cleanly as a daemon, remove for debugging
  • -p is the port it connects to, -p=host_port:docker_port

Using docker-pinry

Open a browser to http://<YOUR-HOSTNAME>:10000 and register. Replace YOUR-HOSTNAME with the name of the machine docker is running on, likely localhost.

Why include nginx and not just map to uwsgi directly?

Because uwsgi/django can't serve static files very well and it is unwise to do so for security reasons. I built this so that people can have a full hosted solution in a container. If you have a host machine running nginx then of course there is no point to run nginx in the container as well, you can simply disable nginx, map uwsgi to a port and then set your host machine's nginx to display your media and static files since that directory is shared between the container and host.

Why use sqlite3?

Because it has a very low resource cost and most pinry websites are small personal ones. Why have a full on database for that? If you need more power than you can easily modify the pinry/settings/production.py to point to a stronger database solution.

docker-pinry's People

Contributors

overshard avatar jasonsturges avatar rholak avatar tylerstalder avatar

Watchers

Robert H avatar  avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.