forked from gjerokrsteski/reactphp-pimf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (27 loc) · 854 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Base image
FROM alpine:latest
## Copy modified PHP files into container
COPY . /php-react
## Set working directory
WORKDIR /php-react
## Install PHP
RUN apk apk update && \
apk upgrade && \
apk add --update tzdata && \
apk add git && \
apk add --update php-common php-json php-curl php-pdo php-pdo_sqlite php-phar php-cli php-openssl php-ctype php-mcrypt && \
apk del tzdata && \
rm -rf /var/cache/apk/*
## Install ReactPHP and PIMF micro frameworks
RUN curl -s http://getcomposer.org/installer | php
RUN php composer.phar update
RUN php composer.phar install
RUN php composer.phar dump-autoload --optimize
## Create SQLite table
RUN php create-table.php
## Expose port
EXPOSE 666
## Set a volume for SQLite database
VOLUME /php-react/app/Articles/_database
## Run the reactive API server
ENTRYPOINT php run-server.php