Collection of Docker containers orchestrated to easily deploy new P2P VPS servers.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.p2pvps/auth
nginx
open-bazaar
persist
sshd-container
support-docs
.gitignore
.npmrc
Dockerfile
LICENSE.md
README.md
docker-compose.yml
dummyapp.js
init
init-open-bazaar
package.json
server-stack.jpg

README.md

server-deployment

This repository is a collection of Docker files, orchestrated to work together using Docker Compose, in order to support and run the P2P VPS Server. The software stack can be illustrated as below, and you can read all the details in the specifications.

Software Stack

Installation (Rough Draft)

It's assumed that you are starting with a fresh installation of Ubuntu 16.04 LTS on a 64-bit machine. It's also assumed that you are installing as a non-root user with sudo privileges.

  1. Install Docker on the host system. Steps 1 and 2 in this tutorial shows how to install Docker on a Ubuntu 16.04 system. It's specifically targeted to Digital Ocean's cloud servers, but should work for any Ubuntu system. Use this link to sign up for a Digital Ocean account and get a $10 credit, capable of running a $5 server for two months.

  2. Install Docker Compose too, following Step 1 of this tutorial. Again, it focuses on a Ubuntu system.

  1. Clone this repository in your home directory with the following command:
    git clone https://github.com/P2PVPS/server-deployment2
  • Enter the new server-deployment2 directory, then initialize the repository by running ./init.

  • Initialize and configure the OpenBazaar store by running ./init-open-bazaar.

  • You'll also need to clone and install the Listing Manager, which lives in its own repository. Go there now and follow the installation instructions.

  • Enter the server-deployment/sshd-container directory and build that image with ./buildImage.

  • Enter the server-deployment directory and build the server software with this comment:
    docker-compose build

    • If you get this error:
      ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
      Delete the data directory with this command:
      sudo rm -rf data
  • Bring all the containers online by running the following command: docker-compose up. Ensure there are no obvious error messages.

  • Bring the containers down by hitting Ctrl-C. Once back to a command line, run docker-compose down to clean up. Then navigate to the the open-bazaar directory.

  • Customize the config file and then copy it into the data directory with sudo cp config ~/.p2pvps/openbazaar/. The current config file has username/password set as yourUsername/yourPassword, and no SSL encryption on connection. Both of these should be updated and configured as per the OpenBazaar security doc

  • Go back to the server-deployment directory and run the containers again with docker-compose up -d. The -d daemonizes the process, letting it run in the background.

  • Now that you have the back end of the server running, follow the directions in the Dashboard repository to setup the front end.

To be removed: You can also follow these nginx instructions to setup nginx in front of your Docker container in order to forward traffic from port 80 (the normal web browser port) to port 3000, and also how to install an SSL certificate from Let's Encrypt for implementing HTTPS.

Docker Debugging

The following commands are useful for debugging applications like this one inside a Docker container. The commands below help you to enter a shell inside the container.

  • docker ps -a

    • Show all docker processes, including ones that are stopped.
  • docker exec -it <container ID> bash

    • This command will let you enter a bash shell inside a running Docker container.
  • docker container run --name test-container --rm -it <Image ID> bash

    • This command will run a docker container and drop you into a bash shell. All you need is the image ID.

If you receive the following error message when executing docker-compose build:
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

Then you need to delete the data directory and recreate it with these commands:

sudo rm -rf data
mkdir data

License

MIT License