ARG VERSION
ARG ENVIRONMENT

FROM nginx:${VERSION}-alpine

LABEL maintainer "Sagar <sagar@practice.in>"

ENV ME=nginx \
    SRC=./
ENV CONFS=${SRC}deployment/docker/php-nginx/${ME}/confs/

#RUN apk add --no-cache openssl \
#  && openssl req -x509 -nodes -days 365 -subj "/C=CA/ST=QC/O=Company, Inc./CN=practice.com" -addext "subjectAltName=DNS:practice.com" -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt

COPY ${CONFS}/sites-enabled/ /etc/nginx/conf.d/

COPY --from=practice_php:latest /web/practice/ /web/practice/
