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

Commit

Permalink
refs #12
Browse files Browse the repository at this point in the history
* work in progress on Dockerfile
* TODO local user passthru to nginx
  • Loading branch information
Bastian Rang committed Aug 3, 2017
1 parent 4578c00 commit f760cc8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
.gitignore
.git
57 changes: 50 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
FROM php:7.1-alpine
RUN apk add --no-cache git curl tar
ARG PHP_VERSION=7.2-rc
FROM php:${PHP_VERSION}-alpine

ARG PHP_VERSION
ARG DOCKER_COMPOSE_VERSION=1.15.0
ARG RANCHER_COMPOSE_VERSION=v0.12.5
ARG RANCHERIZE_HOME=/home/rancherize
ARG DEFAULT_EDITOR=vi

LABEL maintainer="b.rang@ipunkt.biz" \
version.php=$PHP_VERSION \
version.docker-compose=$DOCKER_COMPOSE_VERSION \
version.rancher-compose=$RANCHER_COMPOSE_VERSION

# prepare pseudo project directory for npm_modules install
RUN ["mkdir", "$RANCHERIZE_HOME"]
RUN ["chmod", "777", "$RANCHERIZE_HOME"]

VOLUME $RANCHERIZE_HOME

# there lies the home
ENV HOME=$RANCHERIZE_HOME

# default editor
ENV EDITOR=DEFAULT_EDITOR

# install packages
RUN apk update \
&& apk add --no-cache \
git \
docker \
py-pip

COPY [".", "/opt/rancherize"]
RUN cd /opt/rancherize \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
WORKDIR /opt/rancherize

# load rancher-compose
RUN curl -SL "https://github.com/rancher/rancher-compose/releases/download/$RANCHER_COMPOSE_VERSION/rancher-compose-linux-amd64-$RANCHER_COMPOSE_VERSION.tar.gz" \
| tar xz \
&& mv rancher-compose-$RANCHER_COMPOSE_VERSION/rancher-compose .

# install composer packages
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" \
&& ./composer.phar install && rm composer.phar
RUN cd /opt/rancherize \
&& curl -SL "https://github.com/rancher/rancher-compose/releases/download/v0.12.5/rancher-compose-linux-amd64-v0.12.5.tar.gz" | tar xz
ENTRYPOINT ["/bin/sh"]

# install docker-compose
RUN pip install docker-compose==$DOCKER_COMPOSE_VERSION

# change workdir to project
WORKDIR $RANCHERIZE_HOME/project
ENTRYPOINT ["/opt/rancherize/rancherize"]
#ENTRYPOINT ["/bin/sh"]
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@ of of adding and connecting services.

For a concrete example on how the configuration becomes easier through this see the example at the bottom of this page.

# Requirements
# Usage as docker container (preferred)
Rancherize comes bundled as Docker Container `ipunktbs/rancherize`.

To use it, just make an Shell alias:
```
alias rancherize='docker run -it -v $HOME/.rancherize:/home/rancherize/.rancherize -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/home/rancherize/project ipunktbs/rancherize'
```
From now on just use Rancherize without any dependencies for your local environment.

# Usage in project
## Requirements
Rancherize creates configuration to be used with external docker tools. Thus it is necessary to have the following tools
installed to use Rancherize:

- `docker` https://docs.docker.com/engine/installation/
- `docker-compose` https://docs.docker.com/compose/install/
- `rancher-compose` https://docs.rancher.com/rancher/v1.2/en/cattle/rancher-compose/#installation

# Installation
## Installation
Rancherize is installed using composer

composer require 'ipunkt/rancherize:^2.5.0'
Expand Down Expand Up @@ -205,7 +215,7 @@ in a single place.
"DB_HOST":"database",
"DB_USER":"example_user",
"DB_PASSWORD":"example_password",
"DB_DATABASE":"example_db",
"DB_DATABASE":"example_db"
}
},
"environments":{
Expand All @@ -216,7 +226,7 @@ in a single place.
},
"staging":{
"environment":{
"APP_ENV":"staging",
"APP_ENV":"staging"
}
}
}
Expand All @@ -232,11 +242,11 @@ in a single place.
"database":"DB/MySql"
},
"environment":{
"APP_ENV":"production"
"APP_ENV":"production",
"DB_HOST":"database",
"DB_USER":"example_user",
"DB_PASSWORD":"example_password",
"DB_DATABASE":"example_db",
"DB_DATABASE":"example_db"
}
},
"staging":{
Expand All @@ -248,7 +258,7 @@ in a single place.
"DB_HOST":"database",
"DB_USER":"example_user",
"DB_PASSWORD":"example_password",
"DB_DATABASE":"example_db",
"DB_DATABASE":"example_db"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"require-dev": {
"phpunit/phpunit": "^5.6",
"mockery/mockery": "^0.9.9",
"ipunkt/rancherize-backup-storagebox": "dev-master"
"ipunkt/rancherize-backup-storagebox": "^1.0.3",
"ipunkt/rancherize-ecr": "^1.0.0",
"ipunkt/rancherize-publish-traefik-rancher": "^1.0.2",
"ipunkt/rancherize-blueprint-php-cli": "dev-master"
}
}

0 comments on commit f760cc8

Please sign in to comment.