Skip to content

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
Adding Docker information
  • Loading branch information
FoxUSA committed Apr 26, 2022
1 parent d1c3f81 commit 24bea4d
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM nginx
ADD dist/ /usr/share/nginx/html/
12 changes: 12 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,15 @@ npm run test:unit

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

### Build the Docker container
```
docker build -t foxusa/storedown:$tag .
# On M1 Macs
docker build --platform linux/amd64 -t foxusa/storedown:latest -t foxusa/storedown:$version .
```

### Push container
```
docker push --all-tags foxusa/storedown
```
89 changes: 87 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,91 @@
# How to Install StoreDown

We are still early days.
We are still in the early days.
I hope to reduce the skills required to use StoreDown.

Currently you can download a [zip of the most recent release](https://github.com/FoxUSA/StoreDown/releases) and extract it in your webserver of choice(S3, Apache, NGINX, etc ....)
> Remember you need to Deploy StoredDown and configure an Apache CouchDB instance.
> StoreDown uses a CouchDB database to sync.
> Instructions on how to setup CouchDB are at the bottom of this file.
> TLDR: Pick an option __AND__ configure CouchDB
## Option 1:
You can download a [zip of the most recent release](https://github.com/FoxUSA/StoreDown/releases) and extract it in your webserver of choice(S3, Apache, NGINX, etc ....)

## Option 2: Using `docker`
`docker run -d -p 8080:80 foxusa/storedown`

## Option 3: Using docker-compose
> If you want to use SSL/TLS skip this and go down to that section
>
Put the following text in a `docker-compose.yml`.
Make sure to set all the items marked `#TODO`.
Also make sure this file is in a secure place.
Your credentials are stored in it.
```
version: "2"
services:
storedown:
image: foxusa/storedown
restart: always
ports:
- "80:80"
couchdb:
image: couchdb
restart: always
volumes:
- "<HOST_LOCATION>:/opt/couchdb/data" #TODO set this to prevent accidentally deleting your database data
ports:
- "5984:5984"
environment:
COUCHDB_USER: user #TODO set this
COUCHDB_PASSWORD: password #TODO set this
```

You can then run `docker-compose up -d` to start the services.

### SSL/TLS
Create a folder with a SSL `private.key` and `public.crt` this gets mounted by nginx to encrypt connections.
The `public.crt` file should have your servers cert and the whole cert chain appended to it.

Create a nginx config file that proxies CouchDB traffic via SSL.
[Here is an example you can use as is.](https://github.com/FoxUSA/OpenNote-Docker/blob/master/samples/nginx/default.conf)

Mount these files using the following `docker-compose.yml`
```
version: "2"
services:
storedown:
image: foxusa/storedown
restart: always
volumes:
- $HOST_LOCATION/certs:/root/certs:ro #TODO set this
- $HOST_LOCATION/storedown.default.conf:/etc/nginx/conf.d/default.conf:ro #TODO file created above
ports:
- 80:80
- 443:443
- 6984:6984 #CouchDB Proxy
links:
- couchdb:couchdb
couchdb:
restart: always
image: couchdb
volumes:
- /opt/StoreDown/couchdb:/opt/couchdb/data
ports:
- 5984:5984
environment:
COUCHDB_USER: $user #TODO set this
COUCHDB_PASSWORD: $password #TODO set this
```

You can then run `docker-compose up -d` to start the services.

---

### CouchDB config
- [ ] Go to `http:https://$serverurl:5984/_utils/#_config/nonode@nohost/cors` and enable CORS for your domain.
- [ ] Go to `http:https://$serverurl:5984/_utils/#_config/nonode@nohost` and set `require_valid_user`(`chttpd` section) to `true`.
>If you are unable to get to the login screen after setting that, you can access it via `http:https://$serverurl:5984/_utils/#login`
- [ ] Then open StoreDown and log in with the username, password, url, port, and database you configured.

0 comments on commit 24bea4d

Please sign in to comment.