ソースを参照

Fix Compose file and document changes

Benoît Hubert 3 年 前
コミット
40c22c8ac6
2 ファイル変更28 行追加5 行削除
  1. 20 1
      README.md
  2. 8 4
      docker-compose.yml

+ 20 - 1
README.md

@@ -9,4 +9,23 @@ Three folders are ignored:
 
 * `mysql` hosting the Gitea db
 * `gitea` containing the Gitea files
-* `drone-server`
+* `drone-server`
+
+## :warning: **IMPORTANT** :warning:
+
+Add this line to the hosts file (`/etc/hosts` on Linux/MacOS, `C:\WINDOWS\SYSTEM32\Drivers\etc\hosts` on Windows).
+
+```
+127.0.0.1	gitea
+```
+
+Otherwise check [How to access host port from docker container](https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container)
+
+## Noob errors
+
+* `DRONE_SERVER_HOST` is the host address from the outside (not for inside the Docker network)
+* Forgot to put Drone Server & Client on the same network as Gitea & MySQL :sweat_smile:
+
+## TODO
+
+* Don't hardcode secrets in Compose file!

+ 8 - 4
docker-compose.yml

@@ -45,14 +45,16 @@ services:
   drone_server:
     image: drone/drone:2
     container_name: drone
+    networks:
+      - gitea
     volumes: 
       - ./drone-server:/data
     environment:
-      - DRONE_GITEA_SERVER=gitea
-      - DRONE_GITEA_CLIENT_ID=74b57866-7c8d-4e88-9a4c-3c1cdfb7b3f4
-      - DRONE_GITEA_CLIENT_SECRET=ozviHt7Y7MX241zrYtsyWvEbGNZD86ToQosaen32P6A6
+      - DRONE_GITEA_SERVER=http://gitea:3000
+      - DRONE_GITEA_CLIENT_ID=c46897dd-a9fd-4e15-943d-63b983f782f1
+      - DRONE_GITEA_CLIENT_SECRET=C8uUrWxSLRbzTkXlLdqjj5oS6wCW6sFavDyUjm3piQmB
       - DRONE_RPC_SECRET=760d5e2dbac871f5d671078d97e6401b
-      - DRONE_SERVER_HOST=drone:8080
+      - DRONE_SERVER_HOST=localhost:8080
       - DRONE_SERVER_PROTO=http
     ports:
       - "8080:80"
@@ -64,6 +66,8 @@ services:
   drone_runner:
     image: drone/drone-runner-docker:1
     container_name: runner
+    networks:
+      - gitea
     volumes:
       - /var/run/docker.sock:/var/run/docker.sock
     environment: