forked from docker/awesome-compose
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anca Iordache <[email protected]>
- Loading branch information
Anca Iordache
committed
Mar 18, 2020
1 parent
63709d1
commit 1138b5d
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
## Gitea with PostgreSQL | ||
This example defines one of the base setups for Gitea. More details on how to customize the installation and the compose file can be found in [Gitea documentation](https://docs.gitea.io/en-us/install-with-docker/). | ||
|
||
|
||
Project structure: | ||
``` | ||
. | ||
├── docker-compose.yaml | ||
└── README.md | ||
``` | ||
|
||
[_docker-compose.yaml_](docker-compose.yaml) | ||
``` | ||
services: | ||
gitea: | ||
image: gitea/gitea:latest | ||
ports: | ||
- 80:3000 | ||
... | ||
db: | ||
image: postgres:alpine | ||
environment: | ||
... | ||
``` | ||
|
||
When deploying this setup, docker-compose maps the nextcloud container port 3000 to | ||
port 80 of the host as specified in the compose file. | ||
|
||
## Deploy with docker-compose | ||
|
||
``` | ||
$ docker$ compose up -d | ||
Creating network "gitea-postgres_default" with the default driver | ||
Creating gitea-postgres_db_1 ... done | ||
Creating gitea-postgres_gitea_1 ... done | ||
Attaching to gitea-postgres_db_1, gitea-postgres_gitea_1 | ||
.... | ||
Starting gitea-postgres_db_1 ... done | ||
Starting gitea-postgres_gitea_1 ... done | ||
``` | ||
|
||
|
||
## Expected result | ||
|
||
Check containers are running and the port mapping: | ||
``` | ||
$ docker ps | ||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | ||
2f5624043da9 gitea/gitea:latest "/usr/bin/entrypoint…" 56 seconds ago Up 16 seconds 22/tcp, 0.0.0.0:80->3000/tcp gitea-postgres_gitea_1 | ||
86acc768453e postgres:alpine "docker-entrypoint.s…" 57 seconds ago Up 17 seconds 5432/tcp gitea-postgres_db_1 | ||
``` | ||
|
||
Navigate to `http://localhost:80` in your web browser to access the installed | ||
Gitea service. | ||
|
||
 | ||
|
||
Stop and remove the containers | ||
|
||
``` | ||
$ docker-compose down | ||
``` | ||
|
||
To remove all Gitea data, delete the named volumes by passing the `-v` parameter: | ||
``` | ||
$ docker-compose down -v | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: '3.7' | ||
services: | ||
gitea: | ||
image: gitea/gitea:latest | ||
environment: | ||
- DB_TYPE=postgres | ||
- DB_HOST=db:5432 | ||
- DB_NAME=gitea | ||
- DB_USER=gitea | ||
- DB_PASSWD=gitea | ||
restart: always | ||
volumes: | ||
- git_data:/data | ||
ports: | ||
- 80:3000 | ||
depends_on: | ||
- db | ||
db: | ||
image: postgres:alpine | ||
environment: | ||
- POSTGRES_USER=gitea | ||
- POSTGRES_PASSWORD=gitea | ||
- POSTGRES_DB=gitea | ||
restart: always | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
volumes: | ||
db_data: | ||
git_data: | ||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.