Skip to content

Instantly share code, notes, and snippets.

@ossentoo
Last active December 12, 2021 17:48
Show Gist options
  • Select an option

  • Save ossentoo/5b8e490bbd5d9743b0b472fe751e7ae0 to your computer and use it in GitHub Desktop.

Select an option

Save ossentoo/5b8e490bbd5d9743b0b472fe751e7ae0 to your computer and use it in GitHub Desktop.

Revisions

  1. ossentoo revised this gist Dec 12, 2021. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -35,10 +35,6 @@ RUN apt-get update \
    && apt-get -y --no-install-recommends install apt-utils libxml2-dev gnupg apt-transport-https \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

    RUN apt-get -yq install curl gnupg ca-certificates \
    && curl -L https://deb.nodesource.com/setup_14.x | bash \
    && apt-get install -yq nodejs

    # Install MS ODBC Driver for SQL Server
    RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
  2. ossentoo created this gist Dec 12, 2021.
    92 changes: 92 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    # syntax=docker/dockerfile:experimental
    FROM node:14.10-slim AS npm_builder
    WORKDIR /frontend
    COPY package.json package-lock.json webpack.mix.js composer.json \
    composer.lock server.js server.php sshd_config ssh_setup.sh /frontend/

    COPY resources/ /frontend/resources/
    COPY config/ /config/
    COPY app/ /app/
    COPY bootstrap/cache/ bootstrap/app.php /bootstrap/

    RUN npm install \
    && npm run production

    FROM php:7.3-fpm

    WORKDIR /web

    ENV ACCEPT_EULA=Y

    # Fix debconf warnings upon build
    ARG DEBIAN_FRONTEND=noninteractive

    # Install powershell
    RUN apt update \
    && apt install -y wget apt-transport-https software-properties-common \
    && wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \
    && dpkg -i packages-microsoft-prod.deb \
    && apt-get update \
    && apt install -y powershell

    # Install selected extensions and other stuff
    RUN apt-get update \
    && apt-get -y install git \
    && apt-get -y --no-install-recommends install apt-utils libxml2-dev gnupg apt-transport-https \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

    RUN apt-get -yq install curl gnupg ca-certificates \
    && curl -L https://deb.nodesource.com/setup_14.x | bash \
    && apt-get install -yq nodejs

    # Install MS ODBC Driver for SQL Server
    RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
    && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list

    # MS sql/obbc driver dependencies
    RUN apt update && apt install wget -y \
    && wget http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/multiarch-support_2.27-3ubuntu1.4_amd64.deb \
    && apt install ./multiarch-support_2.27-3ubuntu1.4_amd64.deb \
    && apt update && apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev

    # Install sql server drivers
    RUN pecl install sqlsrv \
    && pecl install pdo_sqlsrv \
    && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

    COPY custom/php-custom.ini /usr/local/etc/php/php.ini

    # Install Composer
    RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

    COPY composer.json composer.lock /web/
    COPY database/ /web/database/

    COPY . /web/
    COPY .env.local /web/.env

    RUN --mount=type=cache,target=/var/composer composer install \
    --no-interaction \
    --no-plugins \
    --no-scripts \
    --no-dev \
    --prefer-dist

    RUN composer dump-autoload \
    && composer update

    COPY --from=npm_builder /frontend/ /

    COPY artisan package.json package-lock.json /

    COPY pipelines/templates/powershell/UpdateEnvProperties.ps1 /files/

    # Copy the sshd_config file to the /etc/ssh/ directory
    COPY sshd_config /etc/ssh/

    # Open port 8888 for web access
    EXPOSE 8888

    COPY /docker/start.ps1 /files/start.ps1

    CMD ["pwsh", "/files/start.ps1"]