forked from gobuffalo/buffalo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.build
58 lines (39 loc) · 1.61 KB
/
Dockerfile.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM golang:latest
EXPOSE 3000
ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo
ENV GOPROXY=https://proxy.golang.org
RUN go version
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash \
&& sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' \
&& wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - \
&& apt-get update \
&& apt-get install -y -q build-essential nodejs sqlite3 libsqlite3-dev postgresql postgresql-contrib libpq-dev vim \
&& rm -rf /var/lib/apt/lists/*
RUN node -v
RUN npm -v
RUN service postgresql start && \
su -c "psql -c \"ALTER USER postgres WITH PASSWORD 'postgres';\"" - postgres
RUN go get -tags sqlite -v -u github.com/gobuffalo/pop \
&& go get -tags sqlite -v -u github.com/gobuffalo/packr/v2/packr2 \
&& go get -tags sqlite -v -u github.com/gobuffalo/buffalo-pop \
&& rm -rf $GOPATH/src && mkdir -p $BP
# Install golangci
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
WORKDIR $BP
ADD go.mod .
ADD go.sum .
# preps the module cache for those using modules in their images
ENV GO111MODULE=on
RUN go mod tidy -v
RUN npm install -g --no-progress yarn \
&& yarn config set yarn-offline-mirror /npm-packages-offline-cache \
&& yarn config set yarn-offline-mirror-pruning true
COPY . .
RUN packr2 && go install -v -tags sqlite ./buffalo
RUN buffalo version
RUN mkdir -p $GOPATH/src/github.com/markbates
WORKDIR $GOPATH/src/github.com/markbates
RUN buffalo new coke
RUN rm -rf coke
ENV GO111MODULE=off
WORKDIR $GOPATH/src