Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
b9a8c63a
Commit
b9a8c63a
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Dockerize the Application.
parent
10446740
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+8
-15
8 additions, 15 deletions
Dockerfile
docker-compose.yml
+28
-32
28 additions, 32 deletions
docker-compose.yml
docker-entrypoint.sh
+4
-6
4 additions, 6 deletions
docker-entrypoint.sh
opaque.py
+2
-2
2 additions, 2 deletions
opaque.py
with
42 additions
and
55 deletions
Dockerfile
+
8
−
15
View file @
b9a8c63a
FROM
python:3.6-alpine
FROM
python:3.6-alpine
EXPOSE
5000
ENV
FLASK_APP=opaque.py
RUN
apk add
\
RUN
apk add
\
build-base
\
build-base
\
postgresql-dev
postgresql-dev
...
@@ -8,28 +14,15 @@ RUN apk add \
...
@@ -8,28 +14,15 @@ RUN apk add \
RUN
adduser
-D
opaque
RUN
adduser
-D
opaque
USER
opaque
USER
opaque
WORKDIR
/home/opaque
WORKDIR
/home/opaque
COPY
app app
COPY
app app
COPY
migrations migrations
copy
migrations migrations
COPY
config.py opaque.py ./
COPY
config.py opaque.py requirements.txt ./
COPY
requirements.txt requirements.txt
ENV
FLASK_APP=opaque.py
RUN
python
-m
venv venv
&&
\
RUN
python
-m
venv venv
&&
\
venv/bin/pip
install
-r
requirements.txt
venv/bin/pip
install
-r
requirements.txt
COPY
docker-entrypoint.sh /usr/local/bin/
COPY
docker-entrypoint.sh /usr/local/bin/
EXPOSE
5000
ENTRYPOINT
["docker-entrypoint.sh"]
ENTRYPOINT
["docker-entrypoint.sh"]
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
28
−
32
View file @
b9a8c63a
version
:
'
3
.7
'
version
:
'
3'
services
:
services
:
web
:
opaque
:
build
:
.
container_name
:
opaque
container_name
:
opaque_flask
depends_on
:
image
:
gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque
-
opaque_database
volumes
:
-
opaque_redis
-
.:/opaque
-
$HOME/opaque_test:/home/compute/mnt/opaque
env_file
:
env_file
:
-
.env
-
opaque_database_env
-
.env_database
-
opaque_env
image
:
gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque:latest
ports
:
ports
:
-
5000:5000
-
5000:5000
depends_on
:
restart
:
always
-
db
links
:
-
db
command
:
bash flask-entrypoint.sh
daemon
:
container_name
:
opaque_daemon
image
:
gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/daemon_opaque
network_mode
:
"
host"
volumes
:
volumes
:
-
/home/stephan/Repos/own/opaque/data_dev.sqlite:/daemon/db/data_dev.sqlite
-
/opaque_storage:/opaque_storage
-
$HOME/.docker/config.json:/root/.docker/config.json
opaque_daemon
:
container_name
:
opaque_daemon
depends_on
:
depends_on
:
-
db
-
opaque_database
db
:
container_name
:
opaque_db
image
:
postgres:11.5
env_file
:
env_file
:
-
.env
_database
-
opaque
_database
_env
ports
:
image
:
gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/opaque_daemon:latest
-
5432:5432
restart
:
always
volumes
:
volumes
:
-
postgres_data:/var/lib/postgresql/data
-
$HOME/.docker/config.json:/home/opaque_daemon/.docker/config.json
opaque_database
:
container_name
:
opaque_database
env_file
:
opaque_database_env
image
:
postgres:alpine
restart
:
always
volumes
:
-
/opaque_database:/var/lib/postgresql/data
opaque_redis
:
container_name
:
opaque_redis
image
:
redis:alpine
restart
:
always
restart
:
always
volumes
:
postgres_data
:
This diff is collapsed.
Click to expand it.
docker-entrypoint.sh
+
4
−
6
View file @
b9a8c63a
...
@@ -2,14 +2,12 @@
...
@@ -2,14 +2,12 @@
if
[
$#
-eq
0
]
if
[
$#
-eq
0
]
then
then
# If no argument is given, start Opaque
venv/bin/python opaque.py
venv/bin/python opaque.py
else
else
if
[[
$1
==
"--
create-db
"
]]
if
[[
$1
==
"--
setup-database
"
]]
then
then
source
venv/bin/activate
venv/bin/python
-m
flask db init
flask db init
venv/bin/python
-m
flask db upgrade
flask db upgrade
venv/bin/python
-m
flask insert-initial-database-entries
flask foo
fi
fi
fi
fi
This diff is collapsed.
Click to expand it.
opaque.py
+
2
−
2
View file @
b9a8c63a
...
@@ -28,8 +28,8 @@ def test():
...
@@ -28,8 +28,8 @@ def test():
unittest
.
TextTestRunner
(
verbosity
=
2
).
run
(
tests
)
unittest
.
TextTestRunner
(
verbosity
=
2
).
run
(
tests
)
@app.cli.command
()
@app.cli.command
(
'
insert-initial-database-entries
'
)
def
foo
():
def
insert_initial_database_entries
():
Role
.
insert_roles
()
Role
.
insert_roles
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment