2019-02-15 07:13:36 -05:00
|
|
|
FROM monogramm/docker-uxbox-builder:latest
|
2019-02-14 15:55:07 -05:00
|
|
|
|
2019-02-15 12:10:35 -05:00
|
|
|
ENV LEIN_ROOT=TRUE
|
|
|
|
|
2019-02-14 06:59:59 -05:00
|
|
|
# Copy backend source and build release
|
2019-02-14 17:21:15 -05:00
|
|
|
COPY . /home/uxbox/backend
|
2019-02-14 16:20:31 -05:00
|
|
|
RUN set -ex; \
|
2019-02-14 18:25:44 -05:00
|
|
|
cd backend; \
|
2019-02-16 10:50:39 -05:00
|
|
|
rm -f Dockerfile; \
|
2019-02-14 17:51:37 -05:00
|
|
|
bash -c "/home/uxbox/backend/scripts/dist.sh"
|
2019-02-14 06:59:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Once application has been built, prepare production image
|
2019-02-17 12:19:35 -05:00
|
|
|
FROM openjdk:8-jre
|
2019-02-14 06:59:59 -05:00
|
|
|
|
|
|
|
LABEL maintainer="mathieu.brunot at monogramm dot io"
|
|
|
|
|
2019-02-14 14:30:32 -05:00
|
|
|
# Add uxbox as provided by builder
|
|
|
|
COPY --from=0 /home/uxbox/backend/dist/uxbox-backend.jar /srv/uxbox/app.jar
|
2019-02-16 10:50:39 -05:00
|
|
|
COPY --from=0 /home/uxbox/backend/docker-entrypoint.sh /entrypoint.sh
|
2019-02-14 06:59:59 -05:00
|
|
|
|
2019-02-15 18:59:31 -05:00
|
|
|
ENV UXBOX_HTTP_SERVER_DEBUG=false \
|
2019-02-19 16:31:59 -05:00
|
|
|
UXBOX_MEDIA_URI="http://localhost:6060/media/" \
|
2019-02-19 16:39:09 -05:00
|
|
|
UXBOX_MEDIA_DIRECTORY="resources/public/media" \
|
2019-02-19 16:31:59 -05:00
|
|
|
UXBOX_ASSETS_URI="http://localhost:6060/static/" \
|
2019-02-19 16:39:09 -05:00
|
|
|
UXBOX_ASSETS_DIRECTORY="resources/public/static" \
|
2019-02-17 09:14:09 -05:00
|
|
|
UXBOX_DATABASE_USERNAME="uxbox" \
|
|
|
|
UXBOX_DATABASE_PASSWORD="youshouldoverwritethiswithsomethingelse" \
|
|
|
|
UXBOX_DATABASE_NAME="uxbox" \
|
|
|
|
UXBOX_DATABASE_SERVER="localhost" \
|
2019-02-15 18:59:31 -05:00
|
|
|
UXBOX_DATABASE_PORT=5432 \
|
2019-02-17 09:14:09 -05:00
|
|
|
UXBOX_EMAIL_REPLY_TO="no-reply@uxbox.io" \
|
|
|
|
UXBOX_EMAIL_FROM="no-reply@uxbox.io" \
|
|
|
|
UXBOX_SMTP_HOST="localhost" \
|
2019-02-14 06:59:59 -05:00
|
|
|
UXBOX_SMTP_PORT=25 \
|
2019-02-17 09:14:09 -05:00
|
|
|
UXBOX_SMTP_USER="uxbox" \
|
|
|
|
UXBOX_SMTP_PASSWORD="youshouldoverwritethiswithsomethingelse" \
|
2019-02-14 06:59:59 -05:00
|
|
|
UXBOX_SMTP_SSL=false \
|
|
|
|
UXBOX_SMTP_TLS=false \
|
|
|
|
UXBOX_SMTP_ENABLED=false \
|
2019-02-17 09:14:09 -05:00
|
|
|
UXBOX_SECRET=""
|
2019-02-15 22:20:11 -05:00
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
chmod 755 /entrypoint.sh; \
|
|
|
|
mkdir -p /srv/uxbox/resources/public/media; \
|
2019-02-18 20:41:18 -05:00
|
|
|
mkdir -p /srv/uxbox/resources/public/static; \
|
|
|
|
apt-get update -yq && \
|
|
|
|
apt-get install -yq \
|
2019-02-19 06:42:06 -05:00
|
|
|
git \
|
2019-02-18 20:41:18 -05:00
|
|
|
imagemagick \
|
|
|
|
webp \
|
|
|
|
; \
|
|
|
|
apt-get update -yq; \
|
|
|
|
apt-get install -yq \
|
|
|
|
libbz2-dev liblzma-dev zlib1g-dev libfftw3-dev \
|
|
|
|
libfreetype6-dev libfontconfig1-dev libxt-dev \
|
|
|
|
libexif-dev libjpeg-dev libpng-dev libtiff-dev \
|
|
|
|
libwmf-dev libpango1.0-dev librsvg2-bin librsvg2-dev \
|
|
|
|
libxml2-dev libwebp-dev webp \
|
|
|
|
; \
|
|
|
|
git clone https://github.com/ImageMagick/ImageMagick.git imagemagick && \
|
|
|
|
cd imagemagick && \
|
|
|
|
git checkout -f 7.0.8-27 && \
|
|
|
|
./configure --prefix=/opt/img && \
|
|
|
|
make -j2 && \
|
|
|
|
make install && \
|
|
|
|
cd .. && \
|
|
|
|
rm -rf ./imagemagick
|
2019-02-15 22:20:11 -05:00
|
|
|
|
|
|
|
VOLUME /srv/uxbox/resources/public
|
|
|
|
|
|
|
|
WORKDIR /srv/uxbox/
|
2019-02-14 06:59:59 -05:00
|
|
|
|
|
|
|
EXPOSE 6060
|
|
|
|
|
2019-02-14 14:30:32 -05:00
|
|
|
ENTRYPOINT ["sh", "/entrypoint.sh"]
|
|
|
|
CMD ["java", "-jar", "app.jar"]
|