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.

56 lines
1.9 KiB

10 years ago
10 years ago
  1. ### Install Gogs With Docker
  2. Deploying gogs using [Docker](http://www.docker.io/) is as easy as pie. Simple
  3. open the `/dockerfiles/build.sh` file and replace the initial configuration
  4. settings:
  5. ```
  6. DB_TYPE="YOUR_DB_TYPE" # type of database, supports either 'mysql' or 'postgres'
  7. MEM_TYPE="YOUR_MEM_TYPE" # type of memory database, supports either 'redis' or 'memcache'
  8. DB_PASSWORD="YOUR_DB_PASSWORD" # The database password
  9. DB_RUN_NAME="YOUR_DB_RUN_NAME" # The --name option value to use when running the database image
  10. MEM_RUN_NAME="YOUR_MEM_RUN_NAME" # The --name option value to use when running the memory database image
  11. HOST_PORT="YOUR_HOST_PORT" # The port to expose the app on (redirected to 3000 inside the gogs container)
  12. ```
  13. And run:
  14. ```
  15. cd dockerfiles
  16. ./build.sh
  17. ```
  18. The build will take some time, just be patient. After it finishes, it will
  19. display a message that looks like this (the content may be different, depending
  20. on your configuration options):
  21. ```
  22. Now we have the MySQL image(running) and gogs image, use the follow command to start gogs service:
  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. To run the container, just copy the above command:
  26. ```
  27. docker run -i -t --link YOUR_DB_RUN_NAME:db --link YOUR_MEM_RUN_NAME:mem -p YOUR_HOST_PORT:3000 gogits/gogs
  28. ```
  29. Now gogs should be running! Open your browser and navigate to:
  30. ```
  31. http://YOUR_HOST_IP:YOUR_HOST_PORT
  32. ```
  33. During the installation procedure, use the following information:
  34. - The database type should be whichever `DB_TYPE` you selected above
  35. - The database host should be either `db:5432` or `db:3306` for PostgreSQL and
  36. MySQL respectively
  37. - The `RUN_USER` should be whichever user you're running the container with.
  38. Ideally that's `git`, but your individual configuration may vary
  39. - Everything else is configured like a normal gogs installation
  40. Let's 'gogs'!
  41. Ouya~