Skip to content

Commit

Permalink
Compose file for legacy CI/CD environment
Browse files Browse the repository at this point in the history
  • Loading branch information
dpurge committed Mar 25, 2024
1 parent 0192a5b commit ca2aa50
Showing 1 changed file with 124 additions and 2 deletions.
126 changes: 124 additions & 2 deletions content/docs/devops/docker/compose.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,130 @@
# Docker compose

## PostgreSQL
## CI/CD test environment

Todo ...
```yaml
version: 3.8

networks:
pipeline:
external: false

services:

postgres:
image: postgres
container_name: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- pipeline
ports:
- 5432:5432
volumes:
- type: volume
source: postgres
target: /var/lib/postgresql/data
- type: bind
source: ./init.sql
target: /docker-entrypoint-initdb.d/init.sql

pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
environment:
- [email protected]
- PGADMIN_DEFAULT_PASSWORD=pgadmin
networks:
- pipeline
ports:
- 15433:80
volumes:
- type: volume
source: pgadmin
target: /var/lib/pgadmin
depends_on:
- postgres

gitea:
image: gitea/gitea
container_name: gitea
restart: always
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgres:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea
networks:
- pipeline
ports:
- 3000:3000
- 222:22
volumes:
- type: volume
source: gitea
target: /data
depends_on:
- postgres

jenkins:
image: jenkins/jenkins
container_name: jenkins
pribileged: true
user: root
restart: always
environment:
- DOCKER_HOST=unix:///var/run/docker.sock
networks:
- pipeline
ports:
- 8080:8080
- 50000:50000
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
- type: volume
source: jenkins
target: /var/jenkins_home

volumes:
postgres:
pgadmin:
gitea:
jenkins:
```
`.env` file:

```ini
COMPOSE_CONVERT_WINDOWS_PATHS=1
```

`init.sql` file:

```sql
CREATE ROLE gitea
WITH ENCRYPTED PASSWORD 'gitea';
ALTER ROLE gitea
WITH LOGIN;
CREATE DATABASE gitea;
GRANT ALL PRIVILEGES
ON DATABASE gitea
TO gitea;
\c gitea postgres
GRANT ALL
ON SCHEMA public
TO gitea;
```

## MSSQL Server

Expand Down

0 comments on commit ca2aa50

Please sign in to comment.