diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-15 17:29:05 -0300 |
---|---|---|
committer | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-15 17:29:05 -0300 |
commit | 6e7eaf774209bf6dfa55a2ba5bc424eeb2f5ea08 (patch) | |
tree | 08e3bbefe06f327c36e4d94522bd65ceedb3bde5 | |
parent | 7f7625d9b79503d74f938f4be90bc50f926a6d56 (diff) |
docker
-rw-r--r-- | Dockerfile | 12 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | config-init.docker | 42 | ||||
-rw-r--r-- | docker-compose.yml | 26 |
4 files changed, 86 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..050cd0b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.16-alpine AS builder +WORKDIR /build +COPY . . +RUN go build . + +FROM alpine:3.14 +RUN apk --no-cache add imagemagick exiv2 ttf-opensans +WORKDIR /app +COPY --from=builder /build/Server /app +COPY static/ /app/static/ +COPY databaseschema.psql /app +CMD ["/app/Server"] @@ -73,6 +73,8 @@ Any contributions or suggestions are appreciated. Best way to give immediate fee `instancesalt:put your salt string here` Used for secure tripcodes currently. + `redis:redis://localhost` Used for Redis. This should be `redis://localhost` in most cases. + Currently e-mail is not implemented to do anything special, but the code is in place @@ -151,7 +153,10 @@ server { ### Docker -`Please consider submitting a pull request if you set up a FChannel instance with Docker with instructions on how to do so` +A Dockerfile is provided, and an example `docker-compose.yml` exists to base your Docker setup on. +You should use the `config-init.docker` file to configure it and it will work more or less out of the box with it. + +Nothing really has been tested because of #12 which should've been fixed but seems like it hasn't. # Support diff --git a/config-init.docker b/config-init.docker new file mode 100644 index 0000000..6a8b18a --- /dev/null +++ b/config-init.docker @@ -0,0 +1,42 @@ +instance:fchan.xyz +instanceport:3000 +instancename:FChan +instancesummary:FChan is a federated image board instance. + +## For `instancetp` if you plan to support https +## make sure you setup the ssl certs before running the server initially +## do not start with http:// and then switch to https:// +## this will cause issues if switched from on protocol to the other. +## If you do, the database entries will have to be converted to support the change +## this will cause a lot of headaches if switched back and forth. +## Choose which one you are going to support and do not change it for best results. + +instancetp:http:// + +## postgres is at postgres and is setup with default credentials +dbhost:postgres +dbport:5432 +dbname:fchan +dbuser:fchan +dbpass:hackme + +emailserver: +emailport: +emailaddress: +emailpass: + +## enter proxy ip and port if you want to have tor connections supported +## 127.0.0.1:9050 default + +torproxy: + +## Change to true if you want your instance to be added to the public instance index + +publicindex:false + +## add your instance salt here for secure tripcodes + +instancesalt: + +## we have redis at "redis", so... +redis:redis://redis diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..892d598 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3' +services: + postgres: + image: postgres:13.4-alpine + restart: unless-stopped + environment: + POSTGRES_USER: fchan + POSTGRES_PASSWORD: hackme + POSTGRES_DB: fchan + volumes: + - ./pgdata:/var/lib/postgresql/data + redis: + image: redis:6.2-alpine + restart: unless-stopped + fchan: + build: ./ + restart: unless-stopped + volumes: + - ./config:/app/config + - ./public/:/app/public/ + - ./pem/:/app/pem/ + ports: + - "3000:3000" + links: + - redis + - postgres |