commit 965ba984d31761de552b4c77c6c793b0b6a07a13 Author: Calabro, Brandon Date: Sun Jul 20 20:17:53 2025 -0500 Fixes to docker container diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..7bc07ec --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Environment-dependent path to Maven home directory +/mavenHomeManager.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..639900d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0879c62 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cbf909c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +FROM ubuntu:18.04 + +RUN dpkg --add-architecture i386 && \ + apt-get update + +RUN apt-get install -y \ + alien \ + ant \ + bison \ + cmake \ + flex \ + g++-multilib \ + gcc-multilib \ + git \ + libaio1:i386 \ + libboost-dev \ + libboost-program-options-dev \ + libcurl4-gnutls-dev:i386 \ + libncurses5-dev:i386 \ + libsqlite3-dev \ + libxml2-dev:i386 \ + openjdk-11-jdk:i386 \ + psmisc \ + supervisor \ + wget + +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /var/log/supervisor +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf + +RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-basiclite-18.3.0.0.0-1.i386.rpm +RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm +RUN wget https://github.com/SWG-Source/releases/releases/download/instantclients/oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm + +RUN alien -i --target=amd64 oracle-instantclient18.3-basiclite-18.3.0.0.0-1.i386.rpm +RUN alien -i --target=amd64 oracle-instantclient18.3-devel-18.3.0.0.0-1.i386.rpm +RUN alien -i --target=amd64 oracle-instantclient18.3-sqlplus-18.3.0.0.0-1.i386.rpm + +RUN rm -f oracle-instantclient18.3-*-18.3.0.0.0-1.i386.rpm + +ENV ORACLE_HOME=/usr/lib/oracle/18.3/client +ENV LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client/lib:/usr/include/oracle/18.3/client +ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-i386 + +RUN git clone https://github.com/SWG-Source/swg-main.git /swg-main +WORKDIR /swg-main +RUN ant git_update_submods + +RUN echo "db_service = FREEPDB1" > local.properties && \ + echo "dbip = oracle" >> local.properties + +CMD ["/usr/bin/supervisord", "-n"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f8bca63 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# swg-docker + +Instructions: +- Clone this repository +- `docker compose up -d` +- `docker exec -it swg bash` to log into a shell in the swg container +- `ant swg` to compile the game and the assets +- `ant start` to run the server \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..195b395 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,49 @@ +services: + + oracle: + container_name: oracle + hostname: oracle + image: gvenzl/oracle-free:latest + ports: + - "1521:1521" + environment: + ORACLE_PASSWORD: swg + APP_USER: swg + APP_USER_PASSWORD: swg + healthcheck: + test: ["CMD", "healthcheck.sh"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 5s + start_interval: 5s + volumes: + - oradata:/opt/oracle/oradata + + swg: + container_name: swg + hostname: swg + depends_on: + oracle: + condition: service_healthy + build: + context: . + ports: + - "44451-44453:44451-44453/tcp" + - "44462-44464:44462-44464/tcp" + - "44451-44453:44451-44453/udp" + - "44462-44464:44462-44464/udp" + environment: + DB_HOST: oracle + DB_PORT: 1521 + DB_USER: swg + ORACLE_PASSWORD: swg + DB_PASSWORD: swg + tty: true + stdin_open: true + volumes: + - swg-main:/swg-main + +volumes: + oradata: + swg-main: \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..e566bfe --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,18 @@ +[supervisord] +nodaemon=true + +[program:chat] +command=/swg-main/chat/stationchat +directory=/swg-main/chat +autostart=false +autorestart=false +stderr_logfile=/var/log/supervisor/stationchat.err.log +stdout_logfile=/var/log/supervisor/stationchat.out.log + +[program:swg] +command=/swg-main/startServer.sh +directory=/swg-main +autostart=false +autorestart=false +stderr_logfile=/var/log/supervisor/swg.err.log +stdout_logfile=/var/log/supervisor/swg.out.log \ No newline at end of file diff --git a/swg-docker.iml b/swg-docker.iml new file mode 100644 index 0000000..9a5cfce --- /dev/null +++ b/swg-docker.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file