FROM microsoft/dotnet:1.0.3-sdk-projectjson ARG CONFIG_DIR=/etc/default/config-files/ RUN rm -rf /var/log/* COPY ./backend/ /tmp/backend/ ARG WEBAPI_PROJECT=WebApi ARG BUILD_CONFIG=Release ARG CONFIG_DIR=/etc/default/config-files/ RUN echo "Building ${WEBAPI_PROJECT} in ${BUILD_CONFIG} configuration" && \ cd /tmp/backend && \ dotnet restore && \ mkdir /var/www && \ cd /tmp/backend/${WEBAPI_PROJECT} && \ dotnet publish --configuration "${BUILD_CONFIG}" --output /var/www RUN ln -s /var/www/${WEBAPI_PROJECT}.dll /var/www/__RUN_ME.DLL &&\ mkdir "${CONFIG_DIR}" &&\ cp /tmp/backend/${WEBAPI_PROJECT}/appsettings.* "${CONFIG_DIR}" &&\ rm /tmp/backend -rf COPY ./vars-vars /etc/vars-vars COPY ./vars-files /etc/vars-files COPY ./common.sh /common.sh COPY ./run.sh /run.sh EXPOSE 80 CMD ["/run.sh"]