2019-02-15 13:13:36 +01:00
|
|
|
FROM monogramm/docker-uxbox-builder:latest
|
2019-02-14 21:55:07 +01:00
|
|
|
|
2019-02-14 12:59:59 +01:00
|
|
|
ENV API_URL http://127.0.0.1:6060/api
|
|
|
|
|
|
|
|
# Copy frontend source and build release
|
2019-02-14 23:21:15 +01:00
|
|
|
COPY . /home/uxbox/frontend
|
2019-02-14 22:20:31 +01:00
|
|
|
RUN set -ex; \
|
2019-02-14 23:51:37 +01:00
|
|
|
rm -f Dockerfile; \
|
2019-02-14 22:20:31 +01:00
|
|
|
cd frontend; \
|
2019-02-15 00:50:47 +01:00
|
|
|
sed -i \
|
2019-02-14 23:51:37 +01:00
|
|
|
-e 's|"uxbox.config.url" ".*"|"uxbox.config.url" "${API_URL}/api"|g' \
|
2019-02-14 12:59:59 +01:00
|
|
|
scripts/figwheel.clj; \
|
|
|
|
npm install; \
|
|
|
|
npm run dist; \
|
2019-02-15 01:49:06 +01:00
|
|
|
./scripts/dist-main; \
|
|
|
|
./scripts/dist-view; \
|
|
|
|
./scripts/dist-worker; \
|
2019-02-14 12:59:59 +01:00
|
|
|
rm -rf ./dist/**/*.gz ./dist/**/*.br
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Once application has been built, prepare production image
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
LABEL maintainer="mathieu.brunot at monogramm dot io"
|
|
|
|
|
2019-02-14 22:20:31 +01:00
|
|
|
# Copy built app to www root
|
2019-02-14 12:59:59 +01:00
|
|
|
COPY --from=0 /home/uxbox/frontend/dist /usr/share/nginx/html
|
|
|
|
|
|
|
|
# NGINX configurations
|
2019-02-14 13:42:16 +01:00
|
|
|
COPY ./docker-nginx/conf.d /etc/nginx/conf.d
|