Commit 364c6382 authored by hengwen's avatar hengwen

dockerize

parent 3b981e93
Pipeline #95734 passed with stage
in 2 minutes and 5 seconds
FROM timlien/docker-smartfox:latest
FROM openjdk:8-jdk
COPY sqlite-jdbc-3.23.1.jar SFS2X/lib/sqlite-jdbc-3.23.1.jar
COPY World.zone.xml SFS2X/zones/World.zone.xml
COPY visualization SFS2X/www/visualization
COPY AllInOne SFS2X/extensions/AllInOne
WORKDIR /app
#COPY ./rpc.jar ./
#COPY dependencies ./libs
#COPY fmu_for_linux ./lib
RUN apt-get update && apt-get install -y --no-install-recommends openjfx && rm -rf /var/lib/apt/lists/*
CMD java -cp "rpc-1.0.0-SNAPSHOT.jar:." server.rpc.RpcServer 6000
SMARTFOX_PATH=/Applications/SmartFoxServer_2X/SFS2X
#!/usr/bin/env bash
cp $SMARTFOX_PATH/lib/sqlite-jdbc-3.23.1.jar sqlite-jdbc-3.23.1.jar
cp $SMARTFOX_PATH/zones/World.zone.xml World.zone.xml
cp ../rpc/target/rpc-1.0.0-SNAPSHOT.jar ./rpc.jar
cp -r ../libs/fmu_for_linux ./
cp -r ../rpc/target/lib ./dependencies
rm -r config
rm -r visualization
rm -r AllInOne
cp -r $SMARTFOX_PATH/config config
cp -r $SMARTFOX_PATH/www/visualization ./visualization
cp -r $SMARTFOX_PATH/extensions/AllInOne .
docker build -t smartfox .
docker build -t rpc-server .
version: "3"
services:
smartfox:
image: smartfox:latest
zoo1:
image: zookeeper
restart: always
hostname: zoo1
ports:
- 8080:8080 # visualization service
- 9933:9933 # admin panel
- 8787:8787 # jvm debug port
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888
kafka:
image: wurstmeister/kafka
depends_on:
- rmi-server
- postgres
links:
- rmi-server
- postgres
- zoo1
ports:
- 9092:9092
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ZOOKEEPER_CONNECT: zoo1:2181
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
rmi-server:
image: rmi-server:latest
depends_on:
- zoo1
# ports:
# - 10101:10101
restart: always
# hostname: rmi-server
environment:
ZOO_SERVERS: zoo1
rpc-server1:
image: rpc-server:latest
depends_on:
- kafka
- zoo1
ports:
- 10101:10101
- 6000:6000
- 8787:8787
restart: always
hostname: rpc1
environment:
ZOO_SERVERS: zoo1
KAFKA_SERVERS: kafka:9092
volumes:
- ../rpc/target:/app
postgres:
build:
context: ./postgres
dockerfile: Dockerfile
rpc-server2:
image: rpc-server:latest
depends_on:
- kafka
- zoo1
ports:
- 6001:6000
# - 8787:8787
restart: always
hostname: rpc2
# hostname: rmi-server
environment:
POSTGRES_USER: server
POSTGRES_PASSWORD: mmosim
ZOO_SERVERS: zoo1
KAFKA_SERVERS: kafka:9092
volumes:
- ../rpc/target:/app
rpc-server3:
image: rpc-server:latest
depends_on:
- kafka
- zoo1
ports:
- 5432:5432
- 6002:6000
# - 8787:8787
restart: always
hostname: rpc3
# hostname: rmi-server
environment:
ZOO_SERVERS: zoo1
KAFKA_SERVERS: kafka:9092
volumes:
- ../rpc/target:/app
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment