Skip to content

Commit

Permalink
Change build
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jun 12, 2019
1 parent 0d510f6 commit 6c8d2bd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
FROM node:latest as ui
RUN npm install -g gulp browserify babelify
COPY ui/package.json /tmp/
COPY ui/semantic.json /tmp/
RUN cd /tmp && npm install && \
mkdir -p /usr/src/app/ui && \
cp -rf /tmp/node_modules /usr/src/app/ui/
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN cd ui/node_modules/semantic-ui && gulp install
RUN cp -f ui/semantic.theme.config ui/semantic/src/theme.config && \
mkdir -p ui/semantic/src/themes/app && \
cp -rf ui/semantic.theme/* ui/semantic/src/themes/app
RUN cd ui/semantic && gulp build
#FROM node:latest as ui
#RUN npm install -g gulp browserify babelify
#COPY ui/package.json /tmp/
#COPY ui/semantic.json /tmp/
#RUN cd /tmp && npm install && \
# mkdir -p /usr/src/app/ui && \
# cp -rf /tmp/node_modules /usr/src/app/ui/
#WORKDIR /usr/src/app
#COPY . /usr/src/app
#RUN cd ui/node_modules/semantic-ui && gulp install
#RUN cp -f ui/semantic.theme.config ui/semantic/src/theme.config && \
# mkdir -p ui/semantic/src/themes/app && \
# cp -rf ui/semantic.theme/* ui/semantic/src/themes/app
#RUN cd ui/semantic && gulp build

FROM golang:1.11-alpine as app
FROM golang:1.12-alpine as app
RUN apk add -U build-base git
COPY . /go/src/app
WORKDIR /go/src/app
ENV GO111MODULE=on
RUN go build -a -v -tags 'netgo' -ldflags '-w -linkmode external -extldflags -static' -o docker-demo .
RUN go build -mod=vendor -a -v -tags 'netgo' -ldflags '-w -extldflags -static' -o docker-demo .

FROM alpine:latest
RUN apk add -U --no-cache curl
COPY static /static
COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.css static/dist/semantic.min.css
COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.js static/dist/semantic.min.js
COPY --from=ui /usr/src/app/ui/semantic/dist/themes/default/assets static/dist/themes/default/
#COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.css static/dist/semantic.min.css
#COPY --from=ui /usr/src/app/ui/semantic/dist/semantic.min.js static/dist/semantic.min.js
#COPY --from=ui /usr/src/app/ui/semantic/dist/themes/default/assets static/dist/themes/default/
COPY --from=app /go/src/app/docker-demo /bin/docker-demo
COPY templates /templates
ENV COW_COLOR black
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ehazlett/docker-demo

require (
github.com/dustin/go-humanize v0.0.0-20180713052910-9f541cc9db5d
github.com/dustin/go-humanize v0.0.0-20180713052910-9f541cc9db5d // indirect
github.com/urfave/cli v0.0.0-20170926034118-ac249472b7de
)
Empty file modified vendor/github.com/urfave/cli/generate-flag-types
100755 → 100644
Empty file.
Empty file modified vendor/github.com/urfave/cli/runtests
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# github.com/urfave/cli v0.0.0-20170926034118-ac249472b7de
github.com/urfave/cli

0 comments on commit 6c8d2bd

Please sign in to comment.