Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
feat: add example with data container
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Apr 28, 2020
1 parent c61d56c commit d5b205c
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .stackhead/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ all:
ansible_host: 1.2.3.4 # add your own IP here!
stackhead:
applications:
- example_docker
#- example_native
- example_docker_singlecontainer
#- example_docker_multicontainer
28 changes: 28 additions & 0 deletions .stackhead/project/example_docker_multicontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
domain: mydomain.com
deployment:
type: docker
settings:
expose:
service: nginx
port: 80
services:
- name: data
image: getstackhead/project-demo-php:data-latest
- name: nginx
image: saitho/nginx:www
links:
- php
volumes_from:
- data:ro
- name: php
image: getstackhead/php:7.4
user: "${STACKHEAD_USER}"
links:
- db
volumes_from:
- data
- name: db
image: mariadb:10.5
environment:
MYSQL_ROOT_PASSWORD: example
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ deployment:
service: app
port: 8080
services:
app:
image: getstackhead/project-demo-php
- name: app
image: getstackhead/project-demo-php:single
user: 1000:1000
links:
- db
db:
- name: db
image: mariadb:10.5
environment:
MYSQL_ROOT_PASSWORD: example
7 changes: 7 additions & 0 deletions Dockerfiles/data-container.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:latest

WORKDIR /var/www
VOLUME /var/www
COPY src .

CMD tail -f /dev/null
File renamed without changes.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,19 @@ ansible-playbook vendor/getstackhead/deployment/application-deploy.yml
```

After deployment you should see a page that prints "Hello world!" alongside the PHP version and successful database connection.














docker build -t getstackhead/project-demo-php:single-latest -f Dockerfiles/single-container.Dockerfile .

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{ "type": "vcs", "url": "[email protected]:getstackhead/deployment.git" }
],
"require": {
"getstackhead/deployment": "dev-master",
"getstackhead/project-validator": "^1.0"
"getstackhead/deployment": "dev-feature/system_user",
"getstackhead/project-validator": "dev-feature/system_user"
},
"scripts":{
"stackhead-submodules": [
Expand Down
32 changes: 17 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ services:
app:
container_name: "stackhead-test"
build:
context: .
context: Dockerfiles
dockerfile: single-container.Dockerfile
ports:
- 32773:8080
links:
Expand Down

0 comments on commit d5b205c

Please sign in to comment.