Skip to main content

APEX on Docker

docker network create ora
docker run --name oracledb \
--network=ora \
-p 1521:1521 \
-p 5500:5500 \
-v ~/oradata:/opt/oracle/oradata \
-v ~/apex/images/apex:/tmp/apex_install \
-e TZ=America/New_York \oracle/database:18.3.0-se2
docker exec oracledb ./setPassword.sh Oradoc_db1
# Install and configure APEXdocker exec -it oracledb bash -c "source /home/oracle/.bashrc; bash"
cd /tmp/apex-installsqlplus sys/Oradoc_db1@localhost/orclpdb1 as sysdba
-- Install APEX@apexins.sql SYSAUX SYSAUX TEMP /i/
-- APEX REST configuration@apex_rest_config_core.sql oracle oracle
alter user apex_public_user identified by oracle account unlock;

-- From the blog: "Create a network ACE for APEX (this is used when consuming Web services or sending outbound mail):"

declare
l_acl_path varchar2(4000);
l_apex_schema varchar2(100);
begin
for c1 in (select schema
from sys.dba_registry
where comp_id = 'APEX') loop
l_apex_schema := c1.schema;
end loop;
sys.dbms_network_acl_admin.append_host_ace(
host => '*',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => l_apex_schema,
principal_type => xs_acl.ptype_db));
commit;
end;
/
begin
apex_util.set_security_group_id( 10 );
apex_util.create_user(
p_user_name => 'ADMIN',
p_email_address => 'systems@example.com',
p_web_password => 'oracle',
p_developer_privs => 'ADMIN' );
apex_util.set_security_group_id( null );
commit;
end;
/
-- Exit SQLexit

 


#### ORDS

-- Assuming that you have a folder called ~/docker/ordscd ~/docker/ords

git clone https://github.com/martindsouza/docker-ords.git
cd docker-ords
-- Extract the ords.war file from the ords.zip downloadunzip ~/Downloads/ords.*.zip ords.war
cd ~/ords/docker-ords
ORDS_VERSION=18.3.0
docker build -t ords:$ORDS_VERSION .
docker run --name ords\
--network=ora \
-e TZ=America/New_York \
-e DB_HOSTNAME=oracledb \
-e DATABASE_SERVICENAME="orclpdb1" \
-e DB_PORT=1521 \
-e APEX_PUBLIC_USER_PASS=oracle \
-e APEX_LISTENER_PASS=oracle \
-e APEX_REST_PASS=oracle \
-e ORDS_PASS=oracle \
-e SYS_PASS=Oradoc_db1 \
--volume ~/ords/ords-18.3.0/config:/opt/ords \
--volume ~/apex/images/apex/images:/ords/apex-images \
-p 8080:8080 \
ords:18.3.0

 

docker run -t -i \
--name ords \
--network=ora \
-e DATABASE_HOSTNAME="oracledb" \
-e DATABASE_PORT="1521" \
-e DATABASE_SERVICENAME="ORCLPDB1" \
-e DATABASE_PUBLIC_USER_PASS=oracle \
-e APEX_LISTENER_PASS=oracle \
-e APEX_REST_PASS=oracle \
-e ORDS_PASS=oracle \
--volume ~/apex/images:/usr/local/tomcat/webapps/i \
-p 8080:8080 \
lucassampsouza/ords_apex:3.0.9