Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit acc12e3

Browse files
committed
Merge pull request #133 from skyhit/base_docker_image_for_direct_app_local_setup
Provide way to run direct-app locally using Docker Compose
2 parents bd5b1c1 + 2d04ee3 commit acc12e3

File tree

12 files changed

+1517
-0
lines changed

12 files changed

+1517
-0
lines changed

LOCAL_SETUP.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Create Docker Compose Env for Running Direct App Local Deployment Guide
2+
3+
## Deployment
4+
5+
```sh
6+
git clone https://github.com/direct-app/direct-app.git
7+
cd direct-app
8+
git checkout base_docker_image_for_direct_app_local_setup
9+
cp token.properties.docker-local token.properties
10+
cp topcoder_global.properties.docker-local topcoder_global.properties
11+
docker-compose up
12+
```
13+
14+
Then configure the following entry in your hosts file of your computer (NOT the docker container):
15+
16+
192.168.99.100 cockpit.cloud.topcoder.com
17+
18+
Where 192.168.99.100 is the ip address of my docker machine (launched via docker toolbox for windows or mac). If you are using linux, you can simply use 127.0.0.1 here.
19+
20+
Wait until the jboss server is ready, and then open the following link in your browser https://cockpit.cloud.topcoder.com/direct, login with heffan/password. Note that the browser will warn you about the security certificate (as it's generated by me), just ignore and proceed.

docker-compose.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '2'
2+
services:
3+
tc-cache:
4+
build: ./docker/tc-cache
5+
image: "tc-cache"
6+
tc-informix:
7+
image: "appiriodevops/informix:1.1"
8+
tc-direct:
9+
build: ./docker/local-setup/direct-app-base
10+
image: "tc-direct"
11+
links:
12+
- "tc-informix"
13+
- "tc-cache"
14+
volumes:
15+
- ".:/root/direct"
16+
command: sh -c "cd /root/direct && ant first_deploy && /root/jboss-4.2.3.GA/bin/run.sh -b 0.0.0.0"
17+
ports:
18+
- "443:443"
19+
- "8180:8180"
20+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
FROM centos:6
2+
3+
# install tools
4+
RUN yum install -y \
5+
unzip \
6+
wget \
7+
git-all
8+
9+
WORKDIR /root
10+
11+
# install jdk7
12+
13+
RUN wget -O /root/jdk-7u79-linux-x64.rpm --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm"
14+
RUN rpm -ivh jdk-7u79-linux-x64.rpm
15+
16+
# install apache-ant
17+
RUN wget -O /root/apache-ant-1.7.1-bin.zip http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip
18+
RUN unzip /root/apache-ant-1.7.1-bin.zip
19+
20+
# install grails
21+
RUN wget -O /root/grails-1.3.7.zip http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-1.3.7.zip
22+
RUN unzip /root/grails-1.3.7.zip
23+
24+
# install jboss
25+
RUN wget -O /root/jboss-4.2.3.zip http://downloads.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fjboss%2Ffiles%2FJBoss%2FJBoss-4.2.3.GA
26+
RUN unzip /root/jboss-4.2.3.zip
27+
28+
# set env variables
29+
ENV JAVA_HOME /usr/java/jdk1.7.0_79
30+
ENV JBOSS_HOME /root/jboss-4.2.3.GA
31+
ENV GRAILS_HOME /root/grails-1.3.7
32+
ENV ANT_HOME /root/apache-ant-1.7.1
33+
ENV PATH $JAVA_HOME/bin:$GRAILS_HOME/bin:$ANT_HOME/bin:$PATH
34+
35+
# init apache-ant
36+
COPY ant-libs.tgz /root/
37+
RUN tar -xzvf /root/ant-libs.tgz -C ${ANT_HOME}/lib
38+
39+
# init grails
40+
COPY json-rest-api-1.0.8.zip ${GRAILS_HOME}/plugins/grails-json-rest-api-1.0.8.zip
41+
42+
# init jboss
43+
COPY jboss-service.xml ${JBOSS_HOME}/server/default/conf/
44+
COPY myserver.keystore ${JBOSS_HOME}/server/default/conf/
45+
COPY server.xml ${JBOSS_HOME}/server/default/deploy/jboss-web.deployer/
46+
COPY run.conf ${JBOSS_HOME}/bin/
47+
48+
# remove useless files
49+
RUN rm /root/jdk-7u79-linux-x64.rpm
50+
RUN rm /root/jboss-4.2.3.zip
51+
RUN rm /root/apache-ant-1.7.1-bin.zip
52+
RUN rm /root/grails-1.3.7.zip
53+
RUN rm /root/ant-libs.tgz
54+
55+
# create directories configured in properties file
56+
RUN mkdir /root/temp_files
57+
RUN mkdir -p /root/studiofiles/submissions
58+
59+
# expose jboss ports
60+
EXPOSE 8180 443
61+
1.61 MB
Binary file not shown.

0 commit comments

Comments
 (0)