Skip to content

Commit 3ee156c

Browse files
authored
Merge pull request #26 from maxhelias/all-in-one-dockerfile
Gather all Dockerfile in one
2 parents d16662b + 6d77b4b commit 3ee156c

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

Dockerfile

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
1-
FROM php:7.2-fpm-alpine
1+
# the different stages of this Dockerfile are meant to be built into separate images
2+
# https://docs.docker.com/compose/compose-file/#target
3+
4+
ARG PHP_VERSION=7.2
5+
ARG NGINX_VERSION=1.15
6+
7+
### NGINX
8+
FROM nginx:${NGINX_VERSION}-alpine AS symfony_docker_nginx
9+
10+
COPY docker/nginx/conf.d /etc/nginx/conf.d/
11+
COPY public /srv/app/public/
12+
13+
### H2 PROXY
14+
FROM alpine:latest AS symfony_docker_h2-proxy
15+
16+
RUN apk add --no-cache openssl
17+
18+
# Use this self-generated certificate only in dev, IT IS NOT SECURE!
19+
RUN openssl genrsa -des3 -passout pass:NotSecure -out server.pass.key 2048
20+
RUN openssl rsa -passin pass:NotSecure -in server.pass.key -out server.key
21+
RUN rm server.pass.key
22+
RUN openssl req -new -passout pass:NotSecure -key server.key -out server.csr \
23+
-subj '/C=SS/ST=SS/L=Gotham City/O=Symfony/CN=localhost'
24+
RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
25+
26+
FROM nginx:${NGINX_VERSION}-alpine
27+
28+
RUN mkdir -p /etc/nginx/ssl/
29+
COPY --from=symfony_docker_h2-proxy server.key server.crt /etc/nginx/ssl/
30+
COPY ./docker/h2-proxy/default.conf /etc/nginx/conf.d/default.conf
31+
32+
### PHP
33+
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_docker_php
234

335
RUN apk add --no-cache --virtual .persistent-deps \
436
git \
537
icu-libs \
638
zlib
739

840
ENV APCU_VERSION 5.1.11
9-
RUN set -xe \
41+
RUN set -eux \
1042
&& apk add --no-cache --virtual .build-deps \
1143
$PHPIZE_DEPS \
1244
icu-dev \

Dockerfile.h2-proxy

Lines changed: 0 additions & 17 deletions
This file was deleted.

Dockerfile.nginx

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)