build (fix): fix build

This commit is contained in:
Mickael KERJEAN
2018-10-26 19:01:18 +11:00
parent 147bf77b77
commit 62acef6dee
10 changed files with 13 additions and 60 deletions
-50
View File
@@ -1,50 +0,0 @@
FROM alpine:latest
MAINTAINER mickael.kerjean@gmail.com
RUN mkdir -p /tmp/go/src/github.com/mickael-kerjean/ && \
#################
# Dependencies
apk --no-cache --virtual .build-deps add make gcc g++ curl nodejs git go npm && \
mkdir /tmp/deps && \
# libvips #######
cd /tmp/deps && \
curl -L -X GET https://github.com/libvips/libvips/releases/download/v8.7.0/vips-8.7.0.tar.gz > libvips.tar.gz && \
tar -zxf libvips.tar.gz && \
cd vips-8.7.0/ && \
apk --no-cache add libexif-dev tiff-dev jpeg-dev libjpeg-turbo-dev libpng-dev librsvg-dev giflib-dev glib-dev fftw-dev glib-dev libc-dev expat-dev orc-dev && \
./configure && \
make -j 6 && \
make install && \
# libraw ########
cd /tmp/deps && \
curl -X GET https://www.libraw.org/data/LibRaw-0.19.0.tar.gz > libraw.tar.gz && \
tar -zxf libraw.tar.gz && \
cd LibRaw-0.19.0/ && \
./configure && \
make -j 6 && \
make install && \
#################
# Prepare Build
cd /tmp/go/src/github.com/mickael-kerjean && \
git clone --depth 1 https://github.com/mickael-kerjean/nuage && \
cd nuage && \
mkdir -p ./dist/data/ && \
cp -R config ./dist/data/ && \
#################
# Compile Frontend
npm install && \
npm rebuild node-sass && \
NODE_ENV=production npm run build && \
#################
# Compile Backend
cd /tmp/go/src/github.com/mickael-kerjean/nuage/server && \
CGO_LDFLAGS_ALLOW='-fopenmp' GOPATH=/tmp/go go get && \
cd ../ && \
GOPATH=/tmp/go go build -o ./dist/nuage ./server/main.go && \
#################
# Finalise the build
apk --no-cache add ca-certificates vim
EXPOSE 8334
WORKDIR "/tmp/go/src/github.com/mickael-kerjean/nuage"
ENV GOPATH /tmp/go
+11 -8
View File
@@ -1,7 +1,10 @@
FROM alpine:latest
MAINTAINER mickael.kerjean@gmail.com
RUN mkdir -p /tmp/go/src/github.com/mickael-kerjean/ && \
ENV GOPATH /tmp/go
ENV CGO_LDFLAGS_ALLOW='-fopenmp'
RUN mkdir -p $GOPATH/src/github.com/mickael-kerjean/ && \
#################
# Dependencies
apk --no-cache --virtual .build-deps add make gcc g++ curl nodejs git go npm && \
@@ -25,7 +28,7 @@ RUN mkdir -p /tmp/go/src/github.com/mickael-kerjean/ && \
make install && \
#################
# Prepare Build
cd /tmp/go/src/github.com/mickael-kerjean && \
cd $GOPATH/src/github.com/mickael-kerjean && \
git clone --depth 1 https://github.com/mickael-kerjean/nuage && \
cd nuage && \
mkdir -p ./dist/data/ && \
@@ -37,19 +40,19 @@ RUN mkdir -p /tmp/go/src/github.com/mickael-kerjean/ && \
NODE_ENV=production npm run build && \
#################
# Compile Backend
cd /tmp/go/src/github.com/mickael-kerjean/nuage/server && \
CGO_LDFLAGS_ALLOW='-fopenmp' GOPATH=/tmp/go go get && \
cd ../ && \
GOPATH=/tmp/go go build -o ./dist/nuage ./server/main.go && \
cd $GOPATH/src/github.com/mickael-kerjean/nuage/server && go get && cd ../ && \
go build -o ./dist/nuage ./server/main.go && \
#################
# Compile Plugins
cd /tmp/go/src/github.com/mickael-kerjean/nuage/server/plugin &&
cd image && ./build.sh && cd ../ &&
mkdir -p ./dist/data/plugin && \
go build -buildmode=plugin -o ./dist/data/plugin/image.so server/plugin/image_light/index.go && \
#################
# Finalise the build
cd $GOPATH/src/github.com/mickael-kerjean/nuage/ && \
apk --no-cache add ca-certificates && \
mv dist /app && \
cd /app && \
rm -rf $GOPATH && \
rm -rf /tmp/* && \
apk del .build-deps
@@ -1,3 +1,3 @@
#!/bin/bash
#!/bin/sh
go build -buildmode=plugin -o ../../../dist/data/plugin/image.so index.go
@@ -2,7 +2,7 @@ package main
import (
. "github.com/mickael-kerjean/nuage/server/common"
"github.com/mickael-kerjean/nuage/server/plugin/image/lib"
"github.com/mickael-kerjean/nuage/server/plugin/image_light/lib"
"io"
"net/http"
"os"