Last active
February 8, 2021 08:22
-
-
Save alinetskyi/13a5268860ebc7c18ceaaa98ddc8cc45 to your computer and use it in GitHub Desktop.
Drone docker-compose file with db
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
version: "3.6" | |
services: | |
drone: | |
image: drone/drone:1.2.1 | |
volumes: | |
- drone_data:/var/lib/drone | |
- /var/run/docker.sock:/var/run/docker.sock | |
ports: | |
- "80:80" | |
- "443:443" | |
environment: | |
DRONE_GITHUB_SERVER: https://github.com | |
DRONE_DATABASE_DRIVER: postgres | |
DRONE_DATABASE_DATASOURCE: "postgres://drone:Aemahvai7jaili8vo7Us@db:5432/drone?sslmode=disable" | |
DRONE_SECRET: drone_secret | |
DRONE_GITHUB_CLIENT_ID: drone_id | |
DRONE_GITHUB_CLIENT_SECRET: drone_client_secret | |
DRONE_USER_CREATE: "username:alinetskyi,admin:true" | |
DRONE_RUNNER_CAPACITY: 2 | |
DRONE_SERVER_HOST: ci.test.openware.work | |
DRONE_SERVER_PROTO: https | |
DRONE_TLS_AUTOCERT: "true" | |
DRONE_LOGS_TRACE: "true" | |
db: | |
image: "postgres:11" | |
container_name: "my_postgres" | |
ports: | |
- "54320:5432" | |
environment: | |
POSTGRES_USER: drone | |
POSTGRES_PASSWORD: Aemahvai7jaili8vo7Us | |
volumes: | |
- drone_db_data:/var/lib/postgresql/data | |
volumes: | |
drone_data: | |
drone_db_data: |
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
#!/bin/bash | |
COMPOSE_VERSION="1.23.2" | |
COMPOSE_URL="https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" | |
# Create user | |
sudo groupadd drone | |
sudo useradd --create-home --home /home/app --shell /bin/bash \ | |
--gid drone --groups google-sudoers drone | |
# Install docker and docker-compose | |
curl -fsSL https://get.docker.com/ | bash | |
sudo bash <<EOS | |
usermod -aG docker drone | |
curl -L "$COMPOSE_URL" -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
# Install oh-my-zsh | |
apt-get install git zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment