forked from muonsoft/openapi-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (48 loc) · 1.55 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Composer dependencies
FROM composer as vendor
COPY composer.json composer.json
COPY composer.lock composer.lock
COPY symfony.lock symfony.lock
COPY src/ src/
RUN set -xe \
&& composer install \
--ignore-platform-reqs \
--no-dev \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist \
&& composer dump-autoload \
--optimize \
--no-dev \
--classmap-authoritative
# Main image
FROM php:7.3-alpine
LABEL maintainer="Igor Lazarev <[email protected]>"
ARG ROADRUNNER_VERSION=1.4.6
ENV APP_ENV=prod \
SWAGGER_MOCK_SPECIFICATION_URL='' \
SWAGGER_MOCK_LOG_LEVEL='warning' \
SWAGGER_MOCK_CACHE_DIRECTORY='/dev/shm/openapi-cache' \
SWAGGER_MOCK_CACHE_TTL='0' \
SWAGGER_MOCK_CACHE_STRATEGY='disabled'
WORKDIR /app
COPY ./.docker /
COPY . /app
COPY --from=vendor /app/vendor/ /app/vendor/
RUN set -xe \
&& wget -O /tmp/rr.tar.gz "https://github.com/spiral/roadrunner/releases/download/v$ROADRUNNER_VERSION/roadrunner-$ROADRUNNER_VERSION-linux-amd64.tar.gz" \
&& tar -xzvf /tmp/rr.tar.gz -C /tmp \
&& rm -rf /tmp/rr.tar.gz \
&& cp "/tmp/roadrunner-$ROADRUNNER_VERSION-linux-amd64/rr" /usr/local/bin/rr \
&& rm -rf "/tmp/roadrunner-$ROADRUNNER_VERSION-linux-amd" \
&& docker-php-ext-install \
sockets \
opcache \
&& docker-php-ext-enable \
sockets \
opcache \
&& chmod +x /entry-point.sh
EXPOSE 8080
ENTRYPOINT [ "/entry-point.sh" ]
CMD ["/usr/local/bin/rr", "serve", "-d", "-c", "/app/road-runner.dist.yaml"]