Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
shadowban-eu-backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
shadowban-eu-backend
Commits
1ae6b98f
Commit
1ae6b98f
authored
Sep 03, 2019
by
Raphael Beer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/docker' into dev
parents
ab88423f
ff3c6202
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
14 deletions
+59
-14
.env.example
.env.example
+1
-2
Dockerfile
Dockerfile
+8
-0
backend.py
backend.py
+2
-1
docker-compose.development.yml
docker-compose.development.yml
+4
-0
docker-compose.yml
docker-compose.yml
+17
-0
docker-entry.sh
docker-entry.sh
+25
-0
run.sh
run.sh
+2
-11
No files found.
.env.example
View file @
1ae6b98f
...
...
@@ -3,9 +3,8 @@ COOKIE_DIR=./.htcookies
LOG_FILE=./logs/results.log
DEBUG_FILE=./logs/debug.log
PORT=4040
HOST=127.0.0.1
MONGO_HOST=127.0.0.1
MONGO_PORT=27017
MONGO_DB=tester
MONGO_RESULTS_COLLECTION=results
MONGO_OVERSHOT_COLLECTION=overshot
TWITTER_AUTH_KEY=GRAPHQL_KEY
Dockerfile
0 → 100644
View file @
1ae6b98f
FROM
python:3.5.7-slim-buster
RUN
mkdir
/app
WORKDIR
/app
ADD
requirements.txt /app/
ADD
. /app
RUN
pip3
install
--no-cache-dir
-r
./requirements.txt
backend.py
View file @
1ae6b98f
...
...
@@ -531,6 +531,7 @@ parser.add_argument('--log', type=str, default=None, help='log file where test r
parser
.
add_argument
(
'--daemon'
,
action
=
'store_true'
,
help
=
'run in background'
)
parser
.
add_argument
(
'--debug'
,
type
=
str
,
default
=
None
,
help
=
'debug log file'
)
parser
.
add_argument
(
'--port'
,
type
=
int
,
default
=
8080
,
help
=
'port which to listen on'
)
parser
.
add_argument
(
'--host'
,
type
=
str
,
default
=
'127.0.0.1'
,
help
=
'hostname/ip which to listen on'
)
parser
.
add_argument
(
'--mongo-host'
,
type
=
str
,
default
=
'localhost'
,
help
=
'hostname or IP of mongoDB service to connect to'
)
parser
.
add_argument
(
'--mongo-port'
,
type
=
int
,
default
=
27017
,
help
=
'port of mongoDB service to connect to'
)
parser
.
add_argument
(
'--mongo-db'
,
type
=
str
,
default
=
'tester'
,
help
=
'name of mongo database to use'
)
...
...
@@ -563,7 +564,7 @@ def run():
loop
.
run_until_complete
(
login_guests
())
app
=
web
.
Application
()
app
.
add_routes
(
routes
)
web
.
run_app
(
app
,
host
=
'127.0.0.1'
,
port
=
args
.
port
)
web
.
run_app
(
app
,
host
=
args
.
host
,
port
=
args
.
port
)
if
args
.
daemon
:
with
daemon
.
DaemonContext
():
...
...
docker-compose.development.yml
0 → 100644
View file @
1ae6b98f
version
:
"
3.5"
services
:
tester
:
command
:
[
"
bash"
,
"
./run.sh"
,
"
development"
]
docker-compose.yml
0 → 100644
View file @
1ae6b98f
version
:
"
3.5"
services
:
tester
:
build
:
.
command
:
[
"
bash"
,
"
./docker-entry.sh"
]
env_file
:
${EXPECTED_ENV_FILE}
ports
:
-
"
127.0.0.1:${PORT}:${PORT}"
volumes
:
-
.:/app
networks
:
-
mongodb
networks
:
mongodb
:
external
:
name
:
shadowban-eu_mongodb
docker-entry.sh
0 → 100755
View file @
1ae6b98f
#/usr/bin/env bash
echo
"Starting server..."
echo
"--account-file
$ACCOUNT_FILE
"
echo
"--cookie-dir
$COOKIE_DIR
"
echo
"--log
$LOG_FILE
"
echo
"--debug
$DEBUG_FILE
"
echo
"--port "
$PORT
""
echo
"--host "
$HOST
""
echo
"--mongo-host
$MONGO_HOST
"
echo
"--mongo-port
$MONGO_PORT
"
echo
"--mongo-db
$MONGO_DB
"
echo
"--twitter-auth-key
$TWITTER_AUTH_KEY
"
python3
-u
./backend.py
\
--account-file
$ACCOUNT_FILE
\
--cookie-dir
$COOKIE_DIR
\
--log
$LOG_FILE
\
--debug
$DEBUG_FILE
\
--port
"
$PORT
"
\
--host
"
$HOST
"
\
--mongo-host
$MONGO_HOST
\
--mongo-port
$MONGO_PORT
\
--mongo-db
$MONGO_DB
\
--twitter-auth-key
$TWITTER_AUTH_KEY
run.sh
View file @
1ae6b98f
...
...
@@ -13,15 +13,6 @@ if [ ! -f $EXPECTED_ENV_FILE ]; then
fi
echo
"Using configuration from:
$EXPECTED_ENV_FILE
"
source
$EXPECTED_ENV_FILE
echo
"Listening on:
$PORT
"
echo
"Starting server..."
python3 ./backend.py
\
--account-file
$ACCOUNT_FILE
\
--cookie-dir
$COOKIE_DIR
\
--log
$LOG_FILE
\
--debug
$DEBUG_FILE
\
--port
"
$PORT
"
\
--mongo-host
$MONGO_HOST
\
--mongo-port
$MONGO_PORT
\
--mongo-db
$MONGO_DB
\
--twitter-auth-key
$TWITTER_AUTH_KEY
PORT
=
$PORT
EXPECTED_ENV_FILE
=
$EXPECTED_ENV_FILE
docker-compose
-f
docker-compose.yml up
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment