Skip to content

Commit 9c6f233

Browse files
author
mike_jc
committed
Update Dockerfile and README.md
1 parent 1f95c34 commit 9c6f233

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RUN apt-get update \
1313
php5-gd \
1414
rabbitmq-server \
1515
unzip \
16+
vim \
1617
zip \
1718
&& docker-php-ext-install bcmath \
1819
&& rm -rf /var/lib/apt/lists/* \
@@ -21,9 +22,10 @@ RUN apt-get update \
2122
&& echo 'extension=/usr/lib/php5/20131226/gd.so' >> /usr/local/etc/php/php.ini \
2223
&& echo 'extension=bcmath.so' >> /usr/local/etc/php/php.ini
2324

24-
RUN git clone https://github.com/mike-jc/ImageBot.git ImageBot
25-
&& cd ImageBot
25+
RUN git clone https://github.com/mike-jc/ImageBot.git /home/ImageBot \
26+
&& cd /home/ImageBot \
27+
&& php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction --no-scripts
2628

27-
RUN php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction --no-scripts
29+
RUN chmod 755 /home/ImageBot/bin/bot \
30+
&& ln -sv /home/ImageBot/bin/bot /usr/local/bin/bot
2831

29-
RUN chmod 755 bin/bot

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,35 @@ The workflow should be divided into the following independent steps:
77
- Upload resized image to cloud storage.
88

99
## Installation
10-
Via composer:
10+
11+
#### Via composer
1112
```
1213
$ php composer require mike-jc/ImageBot
1314
```
14-
Or as a docker image:
15+
16+
#### Or as a Docker image
1517
```
1618
$ mkdir sandbox && cd sandbox
1719
$ curl -sS https://raw.githubusercontent.com/mike-jc/ImageBot/master/Dockerfile > Dockerfile
1820
$ docker build -t bots/image-bot .
19-
$ docker run -it --volume=<images-directory>:/images --workdir="/images" bots/image-bot
21+
$ docker run -it --volume=<absolute-path-to-images-directory>:/images --workdir="/images" --entrypoint=/bin/bash bots/image-bot
22+
```
23+
After that Docker container will run and you will get into it.
24+
25+
In the running docker container:
26+
```
27+
$ vim /home/ImageBot/config/config.yml
28+
29+
... edit configuration (at least, add cloud storage credentials)
30+
31+
$ /etc/init.d/rabbitmq-server start
32+
33+
... now you're in images directory, so:
34+
35+
$ bot schedule ./
36+
$ bot resize
37+
38+
... use any other bot command you want
2039
```
2140

2241
## Configuration

config/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
queues:
22
host: localhost
33
port: 5672
4-
user: admin
5-
password: admin
4+
user: guest
5+
password: guest
66
names:
77
resize: resize
88
upload: upload

config/config.yml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
queues:
22
host: localhost
33
port: 5672
4-
user: admin
5-
password: admin
4+
user: guest
5+
password: guest
66
names:
77
resize: resize
88
upload: upload

0 commit comments

Comments
 (0)