Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
5d2aff7c
Commit
5d2aff7c
authored
Nov 23, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stub for dockerization
parent
13b4ca1f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
0 deletions
+124
-0
1-create_sql_container.md
setup/dockers/1-create_sql_container.md
+63
-0
Dockerfile
...rs/2-create_flask_container/flask_ispcif_light/Dockerfile
+55
-0
steps.md
setup/dockers/2-create_flask_container/steps.md
+6
-0
No files found.
setup/dockers/1-create_sql_container.md
0 → 100644
View file @
5d2aff7c
# to run docker client without sudo
sudo usermod -aG docker
# then full reboot
# to make a docker with the data
# src: hub.docker.com/r/mysql/mysql-server/
mkdir ../shared_mysql_data
docker create mysql
docker run --detach --name test_again
\
-v /home/romain/comex/shared_mysql_data:/var/lib/mysql
\
--env="MYSQL_ROOT_PASSWORD=mypassword" mysql
# get the ip
export SQLDOCKERIP=$(docker inspect test_again | jq -r '.
[
0
]
.NetworkSettings.IPAddress')
# connect ---------------------------------------------
mysql -uroot -pmypassword -h $SQLDOCKERIP -P 3306
# -----------------------------------------------------
# NB
# also now mysqld --initilize created the following files
~/comex/shared_mysql_data > ll
total 185M
-rw-r----- 1 999 56 2016-11-23 17:49 auto.cnf
-rw-r----- 1 999 1,3K 2016-11-23 17:49 ib_buffer_pool
-rw-r----- 1 999 76M 2016-11-23 17:49 ibdata1
-rw-r----- 1 999 48M 2016-11-23 17:49 ib_logfile0
-rw-r----- 1 999 48M 2016-11-23 17:49 ib_logfile1
-rw-r----- 1 999 12M 2016-11-23 17:49 ibtmp1
drwxr-x--- 2 999 4,0K 2016-11-23 17:49 mysql/
drwxr-x--- 2 999 4,0K 2016-11-23 17:49 performance_schema/
drwxr-x--- 2 999 12K 2016-11-23 17:49 sys/
# --- after connection to mysql
CREATE DATABASE comex_shared ;
USE comex_shared ;
create table comex_registrations (
doors_uid char(36) not null unique,
-- ISO stamp like 2016-11-16T17:47:07.308Z
last_modified_date char(24) not null,
email varchar(255) not null unique primary key,
initials varchar(7) not null,
country varchar(60) not null,
first_name varchar(30) not null,
middle_name varchar(30),
last_name varchar(50) not null,
jobtitle varchar(30) not null,
keywords varchar(350) not null,
institution varchar(120) not null,
institution_type varchar(50) not null,
team_lab varchar(50),
institution_city varchar(50),
interests_text varchar(1200),
community_hashtags varchar(350),
gender char(1),
pic_file blob
) ;
setup/dockers/2-create_flask_container/flask_ispcif_light/Dockerfile
0 → 100644
View file @
5d2aff7c
FROM
ubuntu:xenial
# based on https://github.com/egeland/docker-gunicorn-python3-flask/blob/master/Dockerfile
# MAINTAINER Frode Egeland <egeland@gmail.com>
# Base
ENV
LANG fr_FR.UTF-8
ENV
DEBIAN_FRONTEND noninteractive
RUN
locale-gen fr_FR fr_FR.UTF-8
RUN
dpkg-reconfigure locales
# fine-tuning locales (src: gargantext)
# RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
# sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
# dpkg-reconfigure --frontend=noninteractive locales && \
# echo 'LANG="fr_FR.UTF-8"' > /etc/default/locale
# ENV LANG fr_FR.UTF-8
# ENV LANGUAGE fr_FR.UTF-8
# ENV LC_ALL fr_FR.UTF-8
RUN
apt-get update
&&
apt-get autoclean
RUN
apt-get
install
-y
python3-pip git
# Install global dependencies
RUN
pip3
install
--upgrade
pip
RUN
pip3
install
gunicorn flask
# pull the comex server from repository
RUN
git clone https://github.com/moma/regcomex.git
# don't do this ( start the app at image build XD )
# WORKDIR /regcomex
# RUN gunicorn -b 127.0.0.1:9090 server_comex_registration:app
# but use the running script instead
# if Install gunicorn running script
# ADD run /usr/local/bin/run
# RUN chmod +x /usr/local/bin/run
# if REALLY needed virtualenv (TODO avoid it)
# RUN apt install python3-virtualenv
# RUN virtualenv --python=/usr/bin/python3 setup/regcomex_venv
# RUN setup/regcomex_venv/bin/activate && pip3 install -r setup/requirements.txt
# Volumes
# VOLUME ["/root/app/logs"]
# Ports
EXPOSE
5000:5000
EXPOSE
9090:9090
setup/dockers/2-create_flask_container/steps.md
0 → 100644
View file @
5d2aff7c
```
bash
docker build flask_ispcif_light/
-t
flask_ispcif_light:latest
docker run
-it
--name
comex_flask_test flask_ispcif_light
```
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