Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
amaurycannesson committed Nov 6, 2020
1 parent 4311694 commit 88e545d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
@@ -0,0 +1,26 @@
FROM php:7-cli

RUN apt-get update \
&& apt-get install -y git libmagickwand-dev \
&& rm -rf /var/lib/apt/lists/*

RUN pecl install imagick \
&& docker-php-ext-enable imagick

RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer \
&& chmod +x /usr/local/bin/composer

WORKDIR /app

ADD . .

RUN groupadd -r escpos && useradd escpos -m -r -g escpos \
&& chown -R escpos:escpos /home/escpos \
&& chown -R escpos:escpos /app

USER escpos

RUN composer install

CMD php esc2text.php ./receipt-with-logo.bin
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,13 @@ composer install

- [escimages documentation](doc/escimages.md)

## Run with Docker

```bash
docker build . -t escpos-tools
docker run -v $PWD:/data escpos-tools /bin/bash -c "php esc2html.php /data/receipt-with-logo.bin > /data/output.html"
```

## Contribute

- [CONTRIBUTING.md](CONTRIBUTING.md)
Expand Down

0 comments on commit 88e545d

Please sign in to comment.