Run sqlite environment in docker
Cette révision appartient à :
Parent
213c173719
révision
9ddb5482df
8 fichiers modifiés avec 50 ajouts et 0 suppressions
2
.gitignore
externe
2
.gitignore
externe
|
@ -8,3 +8,5 @@ nyaa-master.exe
|
||||||
*.swp
|
*.swp
|
||||||
.vscode
|
.vscode
|
||||||
templates/*.html.go
|
templates/*.html.go
|
||||||
|
*.backup
|
||||||
|
tags
|
||||||
|
|
2
deploy/.env
Fichier normal
2
deploy/.env
Fichier normal
|
@ -0,0 +1,2 @@
|
||||||
|
PANTSU_EXTERNAL_PORT=9999
|
||||||
|
PANTSU_INTERNAL_PORT=9999
|
5
deploy/Dockerfile
Fichier normal
5
deploy/Dockerfile
Fichier normal
|
@ -0,0 +1,5 @@
|
||||||
|
FROM golang:1.8.1
|
||||||
|
|
||||||
|
RUN mkdir -p /nyaa
|
||||||
|
|
||||||
|
WORKDIR /nyaa
|
19
deploy/docker-compose.sqlite.yml
Fichier normal
19
deploy/docker-compose.sqlite.yml
Fichier normal
|
@ -0,0 +1,19 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
pantsu:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: deploy/Dockerfile
|
||||||
|
command: ./deploy/init.sh
|
||||||
|
env_file:
|
||||||
|
- sqlite.env
|
||||||
|
environment:
|
||||||
|
- PANTSU_INTERNAL_PORT=${PANTSU_INTERNAL_PORT}
|
||||||
|
ports:
|
||||||
|
# 0.0.0.0 makes it accessible to the network
|
||||||
|
# You may want to remove it to make pantsu available only
|
||||||
|
# to localhost
|
||||||
|
- 0.0.0.0:${PANTSU_EXTERNAL_PORT}:${PANTSU_INTERNAL_PORT}
|
||||||
|
volumes:
|
||||||
|
- "${GOPATH}:/go/"
|
||||||
|
- "./..:/nyaa"
|
10
deploy/init.sh
Fichier exécutable
10
deploy/init.sh
Fichier exécutable
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
go get github.com/ewhal/nyaa
|
||||||
|
go build
|
||||||
|
./nyaa -host 0.0.0.0 \
|
||||||
|
-port "${PANTSU_INTERNAL_PORT}" \
|
||||||
|
-dbtype "${PANTSU_DBTYPE}" \
|
||||||
|
-dbparams "${PANTSU_DBPARAMS}"
|
7
deploy/postgres.env
Fichier normal
7
deploy/postgres.env
Fichier normal
|
@ -0,0 +1,7 @@
|
||||||
|
POSTGRES_USER="nyaapantsu"
|
||||||
|
POSTGRES_PASSWORD="nyaapantsu"
|
||||||
|
POSTGRES_DB="nyaa_db"
|
||||||
|
|
||||||
|
PANTSU_DBTYPE="postgres"
|
||||||
|
PANTSU_DBPARAMS="host=pantsu_db user=${POSTGRES_USER} dbname=${POSTGRES_DB} sslmode=disable password=${POSTGRES_PASSWORD}"
|
||||||
|
PANTSU_POSTGRES_DBFILE="nyaa_psql.backup"
|
3
deploy/restore.sh
Fichier normal
3
deploy/restore.sh
Fichier normal
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER}" < "${PANTSU_POSTGRES_DBFILE}"
|
2
deploy/sqlite.env
Fichier normal
2
deploy/sqlite.env
Fichier normal
|
@ -0,0 +1,2 @@
|
||||||
|
PANTSU_DBTYPE="sqlite3"
|
||||||
|
PANTSU_DBPARAMS="./nyaa.db"
|
Référencer dans un nouveau ticket