Gets everything ready for docker
This commit is contained in:
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
FROM python:latest
|
||||||
|
|
||||||
|
|
||||||
|
# RUN apt-get update && apt-get install -y nginx python3 python3-pip python python-pip supervisor
|
||||||
|
|
||||||
|
# COPY poc.conf /etc/nginx/sites-available/poc.conf
|
||||||
|
# RUN rm /etc/nginx/sites-enabled/default && ln -s /etc/nginx/sites-available/poc.conf /etc/nginx/sites-enabled/ && sleep 2 && service nginx start
|
||||||
|
|
||||||
|
COPY pocwww /root/www/pocwww
|
||||||
|
COPY setup.py /root/www/setup.py
|
||||||
|
COPY README.txt /root/www/README.txt
|
||||||
|
COPY CHANGES.txt /root/www/CHANGES.txt
|
||||||
|
COPY MANIFEST.in /root/www/MANIFEST.in
|
||||||
|
COPY generate_cert.sh /root/www/generate_cert.sh
|
||||||
|
RUN chmod +x /root/www/generate_cert.sh
|
||||||
|
RUN /root/www/generate_cert.sh
|
||||||
|
|
||||||
|
RUN pip3 install /root/www/
|
||||||
|
|
||||||
|
COPY production.ini /root/www/production.ini
|
||||||
|
COPY development.ini /root/www/development.ini
|
||||||
|
|
||||||
|
RUN apt-get clean
|
||||||
|
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
EXPOSE 6543
|
||||||
|
|
||||||
|
CMD ["pserve", "/root/www/production.ini", "http_port=6543"]
|
||||||
@@ -18,8 +18,7 @@ pyramid.includes =
|
|||||||
# '127.0.0.1' and '::1'.
|
# '127.0.0.1' and '::1'.
|
||||||
# debugtoolbar.hosts = 127.0.0.1 ::1
|
# debugtoolbar.hosts = 127.0.0.1 ::1
|
||||||
|
|
||||||
mongo_uri = mongodb://poc_www:HenryPump1903@localhost:27017/poc
|
mongo_uri = mongodb://poc_www:HenryPump1903@172.17.0.2:27017/poc
|
||||||
# mongo_uri = mongodb://10.20.155.202:27017/poc
|
|
||||||
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
FROM ubuntu:latest
|
|
||||||
|
|
||||||
# Install MongoDB
|
|
||||||
|
|
||||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
|
|
||||||
RUN echo "deb http://repo.mongodb.org/apt/ubuntu $(cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d= -f2)/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
|
|
||||||
RUN apt-get update && apt-get install -y mongodb-org
|
|
||||||
|
|
||||||
RUN mkdir -p /data/db
|
|
||||||
COPY setup_mongo_admin.js /tmp/setup_mongo_admin.js
|
|
||||||
RUN mongod --fork --logpath=/var/log/mongodb.log && sleep 5 && mongo < /tmp/setup_mongo_admin.js
|
|
||||||
# COPY mongod.conf /etc/mongod.conf
|
|
||||||
EXPOSE 27107
|
|
||||||
|
|
||||||
CMD ["/usr/bin/mongod"]
|
|
||||||
|
|
||||||
# nginx python3 python3-pip python python-pip supervisor
|
|
||||||
# RUN service mongod restart
|
|
||||||
# COPY setup_mongo_users.js /tmp/setup_mongo_users.js
|
|
||||||
# RUN mongo -u "admin" -p "HenryPump@1903" --authenticationDatabase admin < /tmp/setup_mongo_users.js && service mongod restart
|
|
||||||
#
|
|
||||||
# COPY poc.conf /etc/nginx/sites-available/poc.conf
|
|
||||||
# RUN rm /etc/nginx/sites-endabled/default && ln -s /etc/nginx/sites-available/poc.conf /etc/nginx/sites-endabled/ && service nginx restart
|
|
||||||
#
|
|
||||||
# COPY pocwww /root/www/pocwww
|
|
||||||
# COPY production.ini /root/www/production.ini
|
|
||||||
# COPY setup.py /root/www/setup.py
|
|
||||||
# COPY README.txt /root/www/README.txt
|
|
||||||
# COPY CHANGES.txt /root/www/CHANGES.txt
|
|
||||||
# COPY generate_cert.sh /root/www/generate_cert.sh
|
|
||||||
# RUN chmod +x /root/www/generate_cert.sh
|
|
||||||
# RUN /root/www/generate_cert.sh
|
|
||||||
#
|
|
||||||
# RUN pip3 install /root/www/
|
|
||||||
# RUN pserve /root/www/development.ini http_port=6543
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# RUN apt-get clean
|
|
||||||
# RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
||||||
#
|
|
||||||
# EXPOSE 27017
|
|
||||||
#
|
|
||||||
# CMD ["pserve", "/root/www/development.ini", "http_port=6543"]
|
|
||||||
42
mongod.conf
42
mongod.conf
@@ -1,42 +0,0 @@
|
|||||||
# mongod.conf
|
|
||||||
|
|
||||||
# for documentation of all options, see:
|
|
||||||
# http://docs.mongodb.org/manual/reference/configuration-options/
|
|
||||||
|
|
||||||
# Where and how to store data.
|
|
||||||
storage:
|
|
||||||
dbPath: /var/lib/mongodb
|
|
||||||
journal:
|
|
||||||
enabled: true
|
|
||||||
# engine:
|
|
||||||
# mmapv1:
|
|
||||||
# wiredTiger:
|
|
||||||
|
|
||||||
# where to write logging data.
|
|
||||||
systemLog:
|
|
||||||
destination: file
|
|
||||||
logAppend: true
|
|
||||||
path: /var/log/mongodb/mongod.log
|
|
||||||
|
|
||||||
# network interfaces
|
|
||||||
net:
|
|
||||||
port: 27017
|
|
||||||
bindIp: 127.0.0.1
|
|
||||||
|
|
||||||
|
|
||||||
#processManagement:
|
|
||||||
|
|
||||||
security:
|
|
||||||
authorization: enabled
|
|
||||||
|
|
||||||
#operationProfiling:
|
|
||||||
|
|
||||||
#replication:
|
|
||||||
|
|
||||||
#sharding:
|
|
||||||
|
|
||||||
## Enterprise-Only Options:
|
|
||||||
|
|
||||||
#auditLog:
|
|
||||||
|
|
||||||
#snmp:
|
|
||||||
@@ -179,7 +179,6 @@ def main(global_config, **settings):
|
|||||||
config.add_route('users_register', '/register', factory='pocwww.security.UserLoginFactory')
|
config.add_route('users_register', '/register', factory='pocwww.security.UserLoginFactory')
|
||||||
config.add_route("users_json", "/json/users", factory='pocwww.security.UserLoginFactory')
|
config.add_route("users_json", "/json/users", factory='pocwww.security.UserLoginFactory')
|
||||||
|
|
||||||
|
|
||||||
# POC Interface
|
# POC Interface
|
||||||
config.add_route("poc_updateconfig_json", "/json/updateconfig", factory='pocwww.security.UserLoginFactory')
|
config.add_route("poc_updateconfig_json", "/json/updateconfig", factory='pocwww.security.UserLoginFactory')
|
||||||
config.add_route("poc_shake_json", '/json/cmd/shake', factory='pocwww.security.UserLoginFactory') # Shake command is separate for allowing all access
|
config.add_route("poc_shake_json", '/json/cmd/shake', factory='pocwww.security.UserLoginFactory') # Shake command is separate for allowing all access
|
||||||
@@ -189,8 +188,5 @@ def main(global_config, **settings):
|
|||||||
config.add_route('poc_mode_json', '/json/mode', factory='pocwww.security.UserLoginFactory')
|
config.add_route('poc_mode_json', '/json/mode', factory='pocwww.security.UserLoginFactory')
|
||||||
config.add_route('poc_setpoints', '/setpoints', factory='pocwww.security.UserLoginFactory')
|
config.add_route('poc_setpoints', '/setpoints', factory='pocwww.security.UserLoginFactory')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
config.scan()
|
config.scan()
|
||||||
return config.make_wsgi_app()
|
return config.make_wsgi_app()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pyramid.debug_authorization = false
|
|||||||
pyramid.debug_notfound = false
|
pyramid.debug_notfound = false
|
||||||
pyramid.debug_routematch = false
|
pyramid.debug_routematch = false
|
||||||
pyramid.default_locale_name = en
|
pyramid.default_locale_name = en
|
||||||
mongo_uri = mongodb://poc_www:HenryPump1903@localhost:27017/poc
|
mongo_uri = mongodb://poc_www:HenryPump1903@10.10.10.10:27017/poc
|
||||||
|
|
||||||
|
|
||||||
#---------- Pipeline Configuration ----------
|
#---------- Pipeline Configuration ----------
|
||||||
@@ -28,7 +28,7 @@ pipeline =
|
|||||||
|
|
||||||
[server:main]
|
[server:main]
|
||||||
use = egg:waitress#main
|
use = egg:waitress#main
|
||||||
host = 127.0.0.1
|
host = 0.0.0.0
|
||||||
port = %(http_port)s
|
port = %(http_port)s
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,21 @@ poc.createUser({
|
|||||||
roles: [ { role: "readWrite", db: "poc" } ]
|
roles: [ { role: "readWrite", db: "poc" } ]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
poc = db.getSiblingDB('poc');
|
||||||
poc.createUser({
|
poc.createUser({
|
||||||
user: "poc_java",
|
user: "poc_java",
|
||||||
pwd: "HenryPump@1903",
|
pwd: "HenryPump@1903",
|
||||||
roles: [ { role: "readWrite", db: "poc" } ]
|
roles: [ { role: "readWrite", db: "poc" } ]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// db.createUser({
|
||||||
|
// user: "poc_www",
|
||||||
|
// pwd: "HenryPump1903",
|
||||||
|
// roles: [ { role: "readWrite", db: "poc" } ]
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// db.createUser({
|
||||||
|
// user: "poc_java",
|
||||||
|
// pwd: "HenryPump@1903",
|
||||||
|
// roles: [ { role: "readWrite", db: "poc" } ]
|
||||||
|
// });
|
||||||
|
|||||||
Reference in New Issue
Block a user