Commit 329a4f25d061fe5ac163d17aa6dc595c00941dc9
1 parent
2964317a
fix: docker安装部署 update
Showing
6 changed files
with
20 additions
and
29 deletions
Show diff stats
Makefile
conf/conf.yaml
... | ... | @@ -12,13 +12,13 @@ mongo: &default-mongo |
12 | 12 | maxnum: 50 |
13 | 13 | |
14 | 14 | redis: &default-redis |
15 | - address: "127.0.0.1:6100" | |
15 | + address: "192.168.0.100:6100" | |
16 | 16 | auth: "" |
17 | 17 | |
18 | 18 | etcd: |
19 | 19 | dialtimeout: 5 |
20 | 20 | endpoints: |
21 | - - "192.168.0.206:2379" | |
21 | + - "192.168.0.100:2379" | |
22 | 22 | |
23 | 23 | server_account: |
24 | 24 | id: 1 |
... | ... | @@ -68,7 +68,7 @@ server_game1: |
68 | 68 | <<: *default-redis |
69 | 69 | db: 0 |
70 | 70 | test_client: |
71 | - ip: "127.0.0.1" | |
71 | + ip: "192.168.0.100" | |
72 | 72 | port: 8849 |
73 | 73 | count: 1 |
74 | 74 | ... | ... |
docker/Dockerfile
... | ... | @@ -4,7 +4,7 @@ WORKDIR /usr/src/app |
4 | 4 | #RUN go mod download && go mod verify |
5 | 5 | |
6 | 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 | 9 | FROM alpine:3.7 as pro2d |
10 | 10 | # 配置国内源 |
... | ... | @@ -27,7 +27,10 @@ RUN mkdir -p /data/logs && \ |
27 | 27 | source /etc/profile |
28 | 28 | #RUN apt-get update && \ |
29 | 29 | # apt-get install -y net-tools iputils-ping iproute2 |
30 | + | |
30 | 31 | EXPOSE 8080 |
31 | 32 | EXPOSE 8849 |
33 | +EXPOSE 8880 | |
34 | +EXPOSE 6060 | |
32 | 35 | |
33 | 36 | CMD ["http"] |
34 | 37 | \ No newline at end of file | ... | ... |
docker/conf.yaml
... | ... | @@ -23,10 +23,10 @@ etcd: |
23 | 23 | server_account: |
24 | 24 | id: 1 |
25 | 25 | name: "account" |
26 | - ip: "192.168.0.206" | |
26 | + ip: "192.168.0.100" | |
27 | 27 | port: 8080 |
28 | 28 | pool_size: 1 |
29 | - debugport: 6062 | |
29 | + debugport: 6060 | |
30 | 30 | mongo: |
31 | 31 | <<: *default-mongo |
32 | 32 | dbname: "account" |
... | ... | @@ -37,7 +37,7 @@ server_account: |
37 | 37 | server_game: |
38 | 38 | id: 1 |
39 | 39 | name: "game" |
40 | - ip: "192.168.0.206" | |
40 | + ip: "192.168.0.100" | |
41 | 41 | encipher: false |
42 | 42 | port: 8849 |
43 | 43 | debugport: 6060 |
... | ... | @@ -51,22 +51,6 @@ server_game: |
51 | 51 | <<: *default-redis |
52 | 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 | 54 | test_client: |
71 | 55 | ip: "127.0.0.1" |
72 | 56 | port: 8849 | ... | ... |
docker/docker-compose.yml
... | ... | @@ -35,8 +35,10 @@ services: |
35 | 35 | restart: always |
36 | 36 | ports: |
37 | 37 | - '8080:8080' |
38 | + - '6061:6060' #debug | |
38 | 39 | volumes: |
39 | 40 | - ./.docker/account_logs:/data/logs |
41 | + - ./conf.yaml:/data/conf/conf.yaml | |
40 | 42 | working_dir: /data |
41 | 43 | command: [./http] |
42 | 44 | game: |
... | ... | @@ -45,7 +47,10 @@ services: |
45 | 47 | restart: always |
46 | 48 | ports: |
47 | 49 | - '8849:8849' |
50 | + - '6060:6060' #debug | |
51 | + - '8880:8880' #gm | |
48 | 52 | volumes: |
49 | 53 | - ./.docker/game_logs:/data/logs |
54 | + - ./conf.yaml:/data/conf/conf.yaml | |
50 | 55 | working_dir: /data |
51 | 56 | command: [./game] | ... | ... |
docker/restart.sh
1 | 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 | 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 | 8 | \ No newline at end of file | ... | ... |