This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
1,432 additions
and
873 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"command": [ | ||
"java", | ||
"-jar", | ||
"-Xmx128m", | ||
"-Xmx128m", | ||
"FredBoat.jar" | ||
], | ||
"jarName": "FredBoat.jar" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
** | ||
#ignore everything except the following files, they are used in the Dockerfile to build the fredboat image | ||
!Dockerfile | ||
!FredBoat.jar | ||
!config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
ENV ENV docker | ||
|
||
RUN mkdir /opt | ||
RUN mkdir /opt/FredBoat | ||
|
||
COPY config.yaml /opt/FredBoat/config.yaml | ||
COPY FredBoat.jar /opt/FredBoat/FredBoat.jar | ||
|
||
EXPOSE 1356 | ||
|
||
WORKDIR /opt/FredBoat | ||
ENTRYPOINT ["java", "-jar", "-Xmx128m", "FredBoat.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
################################################################################ | ||
### Running FredBoat with docker-compose | ||
################################################################################ | ||
### | ||
### Use a proper text editor like Sublime when editing this file | ||
### Do not use tab characters in this file, only spaces are allowed. Don't add or delete unnecessary spaces. | ||
### More information on correctly formatting yaml files: http://www.yaml.org/start.html | ||
### | ||
### For further information on running FredBoat visit https://fredboat.com/docs/selfhosting or the #selfhosting channel | ||
### on the FredBoat Hangout Discord server: https://discord.gg/cgPFW4q | ||
|
||
|
||
### NOTE: This file builds the docker images from scratch. The means it will only work properly in a checkout out git | ||
### repo with built jar files. If you don't know what that is or how that works, use the docker-compose file in the root | ||
### directory above this one, which will download pre-built docker images from the official docker hub. | ||
|
||
|
||
|
||
version: '3' | ||
services: | ||
|
||
################################################################################ | ||
## Database | ||
################################################################################ | ||
db: | ||
build: ./docker/database/ | ||
restart: on-failure:3 | ||
|
||
# WINDOWS ONLY: if you are running under windows you need to comment out the following two lines: | ||
volumes: | ||
- ./postgres-data:/var/lib/postgresql/data | ||
|
||
# WINDOWS ONLY: if you are running under windows and want to take manual backups of the database | ||
# via a docker volume, uncomment the following two lines and read the snippet at the bottom of this file | ||
#volumes: | ||
#- postgres-data-volume:/var/lib/postgresql/data | ||
|
||
|
||
################################################################################ | ||
## FredBoat | ||
################################################################################ | ||
bot: | ||
build: . | ||
restart: on-failure:3 | ||
depends_on: | ||
- db | ||
ports: | ||
- 1356:1356 | ||
volumes: | ||
- ./config.yaml:/opt/FredBoat/config.yaml | ||
- ./credentials.yaml:/opt/FredBoat/credentials.yaml | ||
- ./logs:/opt/FredBoat/logs | ||
- ./music_persistence:/opt/FredBoat/music_persistence | ||
# Need a bigger memory size or any other custom JVM args? uncomment and edit the line below accordingly | ||
#entrypoint: java -jar -Xmx128m FredBoat.jar | ||
|
||
|
||
################################################################################ | ||
## Automatic updates | ||
################################################################################ | ||
# if you want automatic updates, uncomment the lines below | ||
|
||
#watchtower: | ||
# image: v2tec/watchtower | ||
# restart: on-failure:3 | ||
# volumes: | ||
# - /var/run/docker.sock:/var/run/docker.sock | ||
# command: --cleanup --interval 300 #seconds | ||
|
||
|
||
################################################################################ | ||
## Windows stuff | ||
################################################################################ | ||
|
||
# WINDOWS ONLY: If you are running on Windows and want to be able to backup the postgres data volume, run | ||
# | ||
# docker volume create --name postgres-data-volume -d local | ||
# | ||
# and uncomment the following lines: | ||
# See also the WINDOWS ONLY hints in the database section | ||
|
||
#volumes: | ||
# postgres-data-volume: | ||
# external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM postgres:10.0 | ||
ENV POSTGRES_USER fredboat | ||
COPY postgres-healthcheck.sh /usr/local/bin/ | ||
COPY initdb.sh /docker-entrypoint-initdb.d/ | ||
HEALTHCHECK CMD ["postgres-healthcheck.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "postgres" -d fredboat -c "CREATE EXTENSION hstore;" | ||
psql -v ON_ERROR_STOP=1 --username "postgres" -d fredboat -c "CREATE EXTENSION pg_trgm;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
host="$(hostname -i || echo '127.0.0.1')" | ||
user="${POSTGRES_USER:-postgres}" | ||
db="${POSTGRES_DB:-$POSTGRES_USER}" | ||
export PGPASSWORD="${POSTGRES_PASSWORD:-}" | ||
|
||
args=( | ||
# force postgres to not use the local unix socket (test "external" connectibility) | ||
--host "$host" | ||
--username "$user" | ||
--dbname "$db" | ||
--quiet --no-align --tuples-only | ||
) | ||
|
||
if select="$(echo 'SELECT 1' | psql "${args[@]}")" && [ "$select" = '1' ]; then | ||
exit 0 | ||
fi | ||
|
||
exit 1 |
Oops, something went wrong.