Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
fixes broken Dockerfile.build on master
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Oct 4, 2018
1 parent f1f1f14 commit fac9bb5
Showing 1 changed file with 30 additions and 44 deletions.
74 changes: 30 additions & 44 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,58 +1,44 @@
FROM golang:latest

EXPOSE 3000
ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo
RUN go version
RUN go get -v -u github.com/markbates/deplist/deplist

RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash
RUN apt-get install -y build-essential nodejs
RUN apt-get install -y sqlite3 libsqlite3-dev
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add -
RUN apt-get install -y postgresql postgresql-contrib libpq-dev
RUN apt-get install -y -q mysql-client
RUN apt-get install -y vim

RUN go get -u github.com/golang/dep/cmd/dep
RUN go get -v -u github.com/gobuffalo/makr
RUN go get -v -u github.com/gobuffalo/packr
RUN go get -v -u github.com/gobuffalo/tags
RUN go get -v -u github.com/gobuffalo/pop
RUN go get -v -u github.com/gobuffalo/x/...
RUN go get -v -u github.com/mattn/go-sqlite3
RUN go get -v -u github.com/markbates/filetest
RUN go get -v -u github.com/markbates/grift
RUN go get -v -u github.com/markbates/inflect
RUN go get -v -u github.com/markbates/refresh
RUN go get -v -u github.com/markbates/willie
RUN go get -v -u github.com/gorilla/sessions
RUN go get -v -u golang.org/x/vgo
RUN go get -u github.com/alecthomas/gometalinter
RUN gometalinter --install

RUN npm install -g --no-progress yarn
RUN yarn config set yarn-offline-mirror /npm-packages-offline-cache
RUN yarn config set yarn-offline-mirror-pruning true

ENV BP=$GOPATH/src/github.com/gobuffalo/buffalo
RUN curl -sL https://deb.nodesource.com/setup_8.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 mysql-client vim \
&& rm -rf /var/lib/apt/lists/*

RUN rm -rfv $BP
RUN mkdir -p $BP
WORKDIR $BP
RUN service postgresql start && \
su -c "psql -c \"ALTER USER postgres WITH PASSWORD 'postgres';\"" - postgres

ADD . .
RUN go get -tags "sqlite" -v -t github.com/gobuffalo/buffalo/...
RUN make install
RUN go get -u github.com/golang/dep/cmd/dep \
&& go get -v -u github.com/gobuffalo/pop \
&& go get -v -u github.com/gobuffalo/buffalo-pop \
&& go get -v -u github.com/gobuffalo/packr/packr \
&& go get -v -u github.com/markbates/filetest \
&& go get -v -u github.com/markbates/grift \
&& go get -v -u github.com/markbates/refresh \
&& go get -u github.com/alecthomas/gometalinter \
&& gometalinter --install

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


RUN rm -rfv $BP && mkdir -p $BP
WORKDIR $BP
COPY . .
RUN make ci-deps && make install

# cache yarn packages to an offline mirror so they're faster to load. hopefully.
RUN grep -v '{{' ./generators/assets/webpack/templates/package.json.tmpl > package.json
RUN yarn install --no-progress
RUN grep -v '{{' ./generators/assets/webpack/templates/package.json.tmpl > package.json \
&& yarn install --no-progress

RUN buffalo version

WORKDIR $GOPATH/src

RUN ls -la /npm-packages-offline-cache

EXPOSE 3000

0 comments on commit fac9bb5

Please sign in to comment.