Public Repository

Last pushed: a year ago
Short Description
LM Suggestions app for users to put suggestions and questions about Docker.
Full Description

LM Suggestions app

Installation

Note: Start oracle db (https://hub.docker.com/r/toneloc01/oracle-xe-11g/) before running app

On AWS or other public resources

docker run -d -p 80:80 -t -e oracle_db_ip=<ip>:<port>  --link <db_container> --name lmcloudsuggestions_app toneloc01/lmcloudsuggestions

Within company (also setup the port forwarding in the VirtualBox for 8080 to 8080 so you can use localhost:8080)

docker run -d -p 8080:80 -t -e oracle_db_ip=<ip>:<port> --link <db_container> --name lmcloudsuggestions_app toneloc01/lmcloudsuggestions

Note:

oracle ip will be the VM ip oracle container is running in. 
oracle port will be 1521 because default Oracle XE listens on there (unless you manually changed this)

Oracle setup to run (make script.sh file in container and run it):

sqlplus sys/oracle as sysdba <<SQL >> session.log
create user docker identified by oracle;
grant create session to docker;
grant create table to docker;
grant create sequence to docker;
grant create trigger to docker;
grant unlimited tablespace to docker;

create tablespace docker
  logging
  datafile '/u01/app/oracle/oradata/XE/docker.dbf' 
  size 32m 
  autoextend on 
  next 32m maxsize 2048m
  extent management local;

alter user docker default tablespace docker;

quit
SQL

sqlplus docker/oracle <<SQL >> session.log

CREATE table "SUGGESTIONS" (
    "ID"         NUMBER NOT NULL,
    "SUGGESTION" VARCHAR2(400),
    "ANSWER"     VARCHAR2(400),
    "CREATED"    DATE,
    "UPDATED"    DATE,
    "AUTHOR"     VARCHAR2(200),
     constraint  "SUGGESTIONS_PK" primary key ("ID")
);

CREATE sequence "SUGGESTIONS_SEQ" ;

CREATE TRIGGER  "BI_SUGGESTIONS" 
  before insert on "SUGGESTIONS"               
  for each row  
begin   
  if :NEW."ID" is null then 
    select "SUGGESTIONS_SEQ".nextval into :NEW."ID" from dual; 
  end if; 
end; 
/

ALTER TRIGGER  "BI_SUGGESTIONS" ENABLE;
quit
SQL
Docker Pull Command
Owner
toneloc01

Comments (0)