Merge pull request #240 from HendrikPetertje/feature-add-docker-and-docker-compose
Add docker and docker-compose with instructions for people that want to deploy that way.
This commit is contained in:
commit
72becc0ca2
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
node_moduels
|
||||
ssb-go-room-secrets
|
||||
ssb-go-room-secrets/**/*
|
||||
.git
|
4
.env_example
Normal file
4
.env_example
Normal file
@ -0,0 +1,4 @@
|
||||
HTTPS_DOMAIN=yourhttpsdomainhere
|
||||
ALIASES_AS_SUBDOMAINS=true
|
||||
# uncomment variable if you want to store data in a custom directory (required for default docker-compose setup)
|
||||
# REPO=/ssb-go-room-secrets
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -17,3 +17,7 @@ node_modules
|
||||
|
||||
# goreleaser output
|
||||
dist/
|
||||
|
||||
# secrets and config
|
||||
ssb-go-room-secrets/
|
||||
.env
|
||||
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM golang:1.16-alpine
|
||||
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
git \
|
||||
sqlite \
|
||||
sqlite-dev
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
RUN cd /app/cmd/server && go build && \
|
||||
cd /app/cmd/insert-user && go build
|
||||
|
||||
EXPOSE 8008
|
||||
EXPOSE 3000
|
||||
|
||||
RUN apk del \
|
||||
build-base \
|
||||
git
|
||||
|
||||
CMD ./start.sh
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: '3'
|
||||
services:
|
||||
room:
|
||||
build: .
|
||||
command: 'sh start.sh'
|
||||
env_file: .env
|
||||
ports:
|
||||
- "3000:3000" # Proxypass this port through NGINX or Apache as your HTTP landing & dashboard page
|
||||
- "0.0.0.0:8008:8008" # This is the port SSB clients connect to
|
||||
volumes:
|
||||
- ./ssb-go-room-secrets:/ssb-go-room-secrets
|
@ -21,6 +21,46 @@ After running `sudo dpkg -i go-ssb-room_v1.2.3_Linux_x86_64.deb` pay special att
|
||||
* You should now have a working go-ssb-room binary! Read the HTTP Hosting section below and admin
|
||||
user sections below, for more instructions on the last mile.
|
||||
|
||||
# Docker & Docker-compose
|
||||
|
||||
This project includes a docker-compose.yml file as well as a Docker file. Using
|
||||
it should be fairly straight forward.
|
||||
|
||||
Start off by making a copy of `.env_example` called `.env` and insert your
|
||||
website domain there. With that done execute
|
||||
|
||||
```
|
||||
docker-compose build room
|
||||
```
|
||||
|
||||
Followed by
|
||||
|
||||
```
|
||||
docker-compose up
|
||||
```
|
||||
|
||||
Your database, secrets and other things will be synchronized to a folder in your
|
||||
project called "docker-secrets".
|
||||
|
||||
After starting your server for the first time you need to enter your running
|
||||
server to insert your first user (your docker-compose up should be active).
|
||||
You can do this by:
|
||||
|
||||
```
|
||||
docker-compose exec room sh
|
||||
```
|
||||
|
||||
Then inside the virtual machine:
|
||||
|
||||
```
|
||||
/app/cmd/insert-user/insert-user -repo /ssb-go-room-secrets @your-own-ssb-public-key
|
||||
```
|
||||
|
||||
Fill in your password and then exit your instance by typing `exit`.
|
||||
|
||||
You should setup Nginx or HTTPS load-balancing outside the docker-compose
|
||||
instance.
|
||||
|
||||
# HTTP Hosting
|
||||
|
||||
We currently assume a standard HTTPS server in front of go-ssb-room to facilitate TLS
|
||||
@ -87,4 +127,4 @@ example (with custom repo location, only needed if you setup your with a custom
|
||||
./insert-user -repo "/ssb-go-room-secrets" "@Bp5Z5TQKv6E/Y+QZn/3LiDWMPi63EP8MHsXZ4tiIb2w=.ed25519"
|
||||
```
|
||||
|
||||
You can now login in the web-front-end using these credentials
|
||||
You can now login in the web-front-end using these credentials
|
||||
|
Loading…
Reference in New Issue
Block a user