You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.4 KiB

10 years ago
10 years ago
  1. ### Install Gogs With Docker
  2. Deploying gogs in [Docker](http://www.docker.io/) is just as easy as eating a pie, what you do is just open the `dockerfiles/build.sh` file, replace the configs:
  3. ```
  4. DB_TYPE="YOUR_DB_TYPE" # type of database, support 'mysql' and 'postgres'
  5. MEM_TYPE="YOUR_MEM_TYPE" # type of memory database, support 'redis' and 'memcache'
  6. DB_PASSWORD="YOUR_DB_PASSWORD" # The database password.
  7. DB_RUN_NAME="YOUR_DB_RUN_NAME" # The --name option value when run the database image.
  8. MEM_RUN_NAME="YOUR_MEM_RUN_NAME" # The --name option value when run the mem database image.
  9. HOST_PORT="YOUR_HOST_PORT" # The port on host, which will be redirected to the port 3000 inside gogs container.
  10. ```
  11. And run:
  12. ```
  13. cd dockerfiles
  14. ./build.sh
  15. ```
  16. The build might take some time, just be paient. After it finishes, you will receive the message:
  17. ```
  18. Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service( the content might be different, according to your own configs):
  19. docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs
  20. ```
  21. Just follow the message, run:
  22. ```
  23. docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs
  24. ```
  25. Now we have gogs running! Open the browser and navigate to:
  26. ```
  27. http://YOUR_HOST_IP:YOUR_HOST_PORT
  28. ```
  29. Let's 'gogs'!
  30. Ouya~