Skip to content

Gather all Dockerfile in one #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
FROM php:7.2-fpm-alpine
# the different stages of this Dockerfile are meant to be built into separate images
# https://docs.docker.com/compose/compose-file/#target

ARG PHP_VERSION=7.2
ARG NGINX_VERSION=1.15

### NGINX
FROM nginx:${NGINX_VERSION}-alpine AS symfony_docker_nginx

COPY docker/nginx/conf.d /etc/nginx/conf.d/
COPY public /srv/app/public/

### H2 PROXY
FROM alpine:latest AS symfony_docker_h2-proxy

RUN apk add --no-cache openssl

# Use this self-generated certificate only in dev, IT IS NOT SECURE!
RUN openssl genrsa -des3 -passout pass:NotSecure -out server.pass.key 2048
RUN openssl rsa -passin pass:NotSecure -in server.pass.key -out server.key
RUN rm server.pass.key
RUN openssl req -new -passout pass:NotSecure -key server.key -out server.csr \
-subj '/C=SS/ST=SS/L=Gotham City/O=Symfony/CN=localhost'
RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt

FROM nginx:${NGINX_VERSION}-alpine

RUN mkdir -p /etc/nginx/ssl/
COPY --from=symfony_docker_h2-proxy server.key server.crt /etc/nginx/ssl/
COPY ./docker/h2-proxy/default.conf /etc/nginx/conf.d/default.conf

### PHP
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_docker_php

RUN apk add --no-cache --virtual .persistent-deps \
git \
icu-libs \
zlib

ENV APCU_VERSION 5.1.11
RUN set -xe \
RUN set -eux \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
icu-dev \
Expand Down
17 changes: 0 additions & 17 deletions Dockerfile.h2-proxy

This file was deleted.

4 changes: 0 additions & 4 deletions Dockerfile.nginx

This file was deleted.