This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8c98a1d
Showing
7 changed files
with
92 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,3 @@ | ||
vendor | ||
.idea | ||
*.iml |
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,13 @@ | ||
all: | ||
vars: | ||
# this sets config folder path to "project" folder in project root | ||
mackerel__config_folder: "{{ inventory_dir }}/../project" | ||
ansible_user: root | ||
ansible_connection: ssh | ||
hosts: | ||
myhost: | ||
ansible_host: 1.2.3.4 # add your own IP here! | ||
mackerel: | ||
applications: | ||
- example_docker | ||
#- example_native |
Empty file.
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,37 @@ | ||
# PHP sample project | ||
|
||
This is a sample repository for deploying a PHP application and serving it on a domain using [Mackerel, the Open-Source Web Server management](https://github.com/mackerelserver/deployment). | ||
|
||
## How to use | ||
|
||
### Requirements | ||
|
||
* Ansible | ||
* web server with root SSH access (we recommend renting a pay-per-use VPS at Hetzner) | ||
* top level domain with A record pointing to your server IP | ||
|
||
### Preparation | ||
|
||
1. Install Composer dependencies: | ||
```shell script | ||
composer install | ||
``` | ||
2. Install Ansible dependencies | ||
```shell script | ||
ansible-galaxy install -r vendor/mackerel/deployment/requirements/requirements.yml | ||
``` | ||
3. Change the IP address `1.2.3.4` to your own servers IP in `.mackerel/inventory.yml` | ||
|
||
4. Replace `mydomain.com` with your own domain in `mackerel/example_docker.yaml` | ||
|
||
### Application deployment | ||
|
||
```shell script | ||
ansible-playbook vendor/mackerel/deployment/server-provision.yml | ||
``` | ||
|
||
### Server provisioning | ||
|
||
```shell script | ||
ansible-playbook vendor/mackerel/deployment/application-deploy.yml | ||
``` |
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,3 @@ | ||
[defaults] | ||
inventory = .mackerel/inventory.yml | ||
retry_files_enabled = False |
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,23 @@ | ||
{ | ||
"license": "GPL-2.0-or-later", | ||
"authors": [ | ||
{"name": "Mario Lubenka", "email": "[email protected]", "role": "Lead Developer"} | ||
], | ||
"repositories": [ | ||
{ "type": "vcs", "url": "[email protected]:mackerelserver/deployment.git" } | ||
], | ||
"require": { | ||
"mackerel/deployment": "dev-master" | ||
}, | ||
"scripts":{ | ||
"mackerel-submodules": [ | ||
"cd vendor/mackerel/deployment && git submodule sync && git submodule update --init" | ||
], | ||
"post-install-cmd": [ | ||
"@mackerel-submodules" | ||
], | ||
"post-update-cmd": [ | ||
"@mackerel-submodules" | ||
] | ||
} | ||
} |
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,13 @@ | ||
--- | ||
domain: mydomain.com | ||
deployment: | ||
type: docker | ||
settings: | ||
services: | ||
app: | ||
image: saitho/mackerel-php-project-demo | ||
expose_port: 80 | ||
db: | ||
image: mariadb:10.5 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: example |