Skip to content
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
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Dockerfile
.dockerignore
.gitignore
.nvmrc
node_modules
assets/dist
assets/prod
LICENSE
README.md

30 changes: 20 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
FROM php:7.1-apache
FROM node:10-buster-slim as builder
LABEL author="Devin Matte <matted@csh.rit.edu>"

WORKDIR /usr/src/schedule
COPY package.json ./

RUN npm install

COPY package.json tsconfig.json gulpfile.js ./
COPY assets ./assets
RUN npm run-script build


FROM php:7.3-apache as php-setup
LABEL author="Devin Matte <matted@csh.rit.edu>"

RUN echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
Expand All @@ -21,6 +34,7 @@ RUN apt-get -yq update && \
libjpeg-dev \
libfreetype6-dev \
libxml2-dev \
unzip \
wget \
--no-install-recommends

Expand All @@ -40,22 +54,18 @@ RUN docker-php-ext-install mysqli && \

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


FROM php-setup
LABEL author="Devin Matte <matted@csh.rit.edu>"

COPY apache-config.conf /etc/apache2/sites-enabled/000-default.conf

RUN a2enmod rewrite && a2enmod headers && a2enmod expires && \
sed -i '/Listen/{s/\([0-9]\+\)/8080/; :a;n; ba}' /etc/apache2/ports.conf && \
chmod og+rwx /var/lock/apache2 && chmod -R og+rwx /var/run/apache2

COPY . /var/www/html

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get -yq update \
&& apt-get -yq install nodejs --no-install-recommends \
&& npm install \
&& npm run-script build \
&& apt-get -yq remove nodejs \
&& apt-get -yq clean all \
&& rm -rf node_modules
COPY --from=builder /usr/src/schedule/assets/prod /var/www/html/assets/prod

RUN composer install

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"include": [
"assets/src/modules/sm/**/*.ts"
"./assets/src/modules/sm/**/*.ts"
],
"exclude": ["node_modules"],
"exclude": ["./node_modules"],
"compilerOptions": {
"module": "es2015",
"allowJs": false,
Expand Down