Commit 329a4f25d061fe5ac163d17aa6dc595c00941dc9
1 parent
2964317a
fix: docker安装部署 update
Showing
6 changed files
with
20 additions
and
29 deletions
Show diff stats
Makefile
| @@ -11,7 +11,7 @@ GEN_CLIENT=${WORKSPACE}/luban_examples/Tools/Luban.Client/Luban.Client.dll | @@ -11,7 +11,7 @@ GEN_CLIENT=${WORKSPACE}/luban_examples/Tools/Luban.Client/Luban.Client.dll | ||
| 11 | CONF_ROOT=${WORKSPACE}/DesignerConfigs | 11 | CONF_ROOT=${WORKSPACE}/DesignerConfigs |
| 12 | 12 | ||
| 13 | test: | 13 | test: |
| 14 | - go run cmd/test/client.go | 14 | + go run cmd/test/main.go |
| 15 | http: | 15 | http: |
| 16 | go run $(race) cmd/httpserver/main.go | 16 | go run $(race) cmd/httpserver/main.go |
| 17 | 17 |
conf/conf.yaml
| @@ -12,13 +12,13 @@ mongo: &default-mongo | @@ -12,13 +12,13 @@ mongo: &default-mongo | ||
| 12 | maxnum: 50 | 12 | maxnum: 50 |
| 13 | 13 | ||
| 14 | redis: &default-redis | 14 | redis: &default-redis |
| 15 | - address: "127.0.0.1:6100" | 15 | + address: "192.168.0.100:6100" |
| 16 | auth: "" | 16 | auth: "" |
| 17 | 17 | ||
| 18 | etcd: | 18 | etcd: |
| 19 | dialtimeout: 5 | 19 | dialtimeout: 5 |
| 20 | endpoints: | 20 | endpoints: |
| 21 | - - "192.168.0.206:2379" | 21 | + - "192.168.0.100:2379" |
| 22 | 22 | ||
| 23 | server_account: | 23 | server_account: |
| 24 | id: 1 | 24 | id: 1 |
| @@ -68,7 +68,7 @@ server_game1: | @@ -68,7 +68,7 @@ server_game1: | ||
| 68 | <<: *default-redis | 68 | <<: *default-redis |
| 69 | db: 0 | 69 | db: 0 |
| 70 | test_client: | 70 | test_client: |
| 71 | - ip: "127.0.0.1" | 71 | + ip: "192.168.0.100" |
| 72 | port: 8849 | 72 | port: 8849 |
| 73 | count: 1 | 73 | count: 1 |
| 74 | 74 |
docker/Dockerfile
| @@ -4,7 +4,7 @@ WORKDIR /usr/src/app | @@ -4,7 +4,7 @@ WORKDIR /usr/src/app | ||
| 4 | #RUN go mod download && go mod verify | 4 | #RUN go mod download && go mod verify |
| 5 | 5 | ||
| 6 | COPY . . | 6 | COPY . . |
| 7 | -RUN go build -tags netgo -o /usr/local/bin/http cmd/httpserver/main.go && go build -tags netgo -o /usr/local/bin/game cmd/gameserver/*.go | 7 | +RUN go build -o /usr/local/bin/http cmd/httpserver/main.go && go build -o /usr/local/bin/game cmd/gameserver/*.go |
| 8 | 8 | ||
| 9 | FROM alpine:3.7 as pro2d | 9 | FROM alpine:3.7 as pro2d |
| 10 | # 配置国内源 | 10 | # 配置国内源 |
| @@ -27,7 +27,10 @@ RUN mkdir -p /data/logs && \ | @@ -27,7 +27,10 @@ RUN mkdir -p /data/logs && \ | ||
| 27 | source /etc/profile | 27 | source /etc/profile |
| 28 | #RUN apt-get update && \ | 28 | #RUN apt-get update && \ |
| 29 | # apt-get install -y net-tools iputils-ping iproute2 | 29 | # apt-get install -y net-tools iputils-ping iproute2 |
| 30 | + | ||
| 30 | EXPOSE 8080 | 31 | EXPOSE 8080 |
| 31 | EXPOSE 8849 | 32 | EXPOSE 8849 |
| 33 | +EXPOSE 8880 | ||
| 34 | +EXPOSE 6060 | ||
| 32 | 35 | ||
| 33 | CMD ["http"] | 36 | CMD ["http"] |
| 34 | \ No newline at end of file | 37 | \ No newline at end of file |
docker/conf.yaml
| @@ -23,10 +23,10 @@ etcd: | @@ -23,10 +23,10 @@ etcd: | ||
| 23 | server_account: | 23 | server_account: |
| 24 | id: 1 | 24 | id: 1 |
| 25 | name: "account" | 25 | name: "account" |
| 26 | - ip: "192.168.0.206" | 26 | + ip: "192.168.0.100" |
| 27 | port: 8080 | 27 | port: 8080 |
| 28 | pool_size: 1 | 28 | pool_size: 1 |
| 29 | - debugport: 6062 | 29 | + debugport: 6060 |
| 30 | mongo: | 30 | mongo: |
| 31 | <<: *default-mongo | 31 | <<: *default-mongo |
| 32 | dbname: "account" | 32 | dbname: "account" |
| @@ -37,7 +37,7 @@ server_account: | @@ -37,7 +37,7 @@ server_account: | ||
| 37 | server_game: | 37 | server_game: |
| 38 | id: 1 | 38 | id: 1 |
| 39 | name: "game" | 39 | name: "game" |
| 40 | - ip: "192.168.0.206" | 40 | + ip: "192.168.0.100" |
| 41 | encipher: false | 41 | encipher: false |
| 42 | port: 8849 | 42 | port: 8849 |
| 43 | debugport: 6060 | 43 | debugport: 6060 |
| @@ -51,22 +51,6 @@ server_game: | @@ -51,22 +51,6 @@ server_game: | ||
| 51 | <<: *default-redis | 51 | <<: *default-redis |
| 52 | db: 0 | 52 | db: 0 |
| 53 | 53 | ||
| 54 | -server_game1: | ||
| 55 | - id: 2 | ||
| 56 | - name: "game" | ||
| 57 | - ip: "192.168.0.206" | ||
| 58 | - encipher: false | ||
| 59 | - port: 8850 | ||
| 60 | - debugport: 6061 | ||
| 61 | - gm: 8881 | ||
| 62 | - pool_size: 1 | ||
| 63 | - plugin_path: "./bin/plugin.so" | ||
| 64 | - mongo: | ||
| 65 | - <<: *default-mongo | ||
| 66 | - dbname: "game" | ||
| 67 | - redis: | ||
| 68 | - <<: *default-redis | ||
| 69 | - db: 0 | ||
| 70 | test_client: | 54 | test_client: |
| 71 | ip: "127.0.0.1" | 55 | ip: "127.0.0.1" |
| 72 | port: 8849 | 56 | port: 8849 |
docker/docker-compose.yml
| @@ -35,8 +35,10 @@ services: | @@ -35,8 +35,10 @@ services: | ||
| 35 | restart: always | 35 | restart: always |
| 36 | ports: | 36 | ports: |
| 37 | - '8080:8080' | 37 | - '8080:8080' |
| 38 | + - '6061:6060' #debug | ||
| 38 | volumes: | 39 | volumes: |
| 39 | - ./.docker/account_logs:/data/logs | 40 | - ./.docker/account_logs:/data/logs |
| 41 | + - ./conf.yaml:/data/conf/conf.yaml | ||
| 40 | working_dir: /data | 42 | working_dir: /data |
| 41 | command: [./http] | 43 | command: [./http] |
| 42 | game: | 44 | game: |
| @@ -45,7 +47,10 @@ services: | @@ -45,7 +47,10 @@ services: | ||
| 45 | restart: always | 47 | restart: always |
| 46 | ports: | 48 | ports: |
| 47 | - '8849:8849' | 49 | - '8849:8849' |
| 50 | + - '6060:6060' #debug | ||
| 51 | + - '8880:8880' #gm | ||
| 48 | volumes: | 52 | volumes: |
| 49 | - ./.docker/game_logs:/data/logs | 53 | - ./.docker/game_logs:/data/logs |
| 54 | + - ./conf.yaml:/data/conf/conf.yaml | ||
| 50 | working_dir: /data | 55 | working_dir: /data |
| 51 | command: [./game] | 56 | command: [./game] |
docker/restart.sh
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | -host='-H 192.168.0.100:2375' | ||
| 4 | -docker-compose -f /Users/zhaolu/Documents/pro2d/docker-compose.yml down | ||
| 5 | -docker load < /Users/zhaolu/Documents/pro2d/pro2d.tar | ||
| 6 | -docker-compose -f /Users/zhaolu/Documents/pro2d/docker-compose.yml up -d | ||
| 7 | -docker ps -a | ||
| 8 | \ No newline at end of file | 3 | \ No newline at end of file |
| 4 | +/usr/local/bin/docker-compose -f /Users/zhaolu/Documents/pro2d/docker-compose.yml down | ||
| 5 | +/usr/local/bin/docker load < /Users/zhaolu/Documents/pro2d/pro2d.tar | ||
| 6 | +/usr/local/bin/docker-compose -f /Users/zhaolu/Documents/pro2d/docker-compose.yml up -d | ||
| 7 | +/usr/local/bin/docker ps -a | ||
| 9 | \ No newline at end of file | 8 | \ No newline at end of file |