Skip to content

Commit

Permalink
docker: change release image build to debian, roll quay back to v6
Browse files Browse the repository at this point in the history
leveldown segfaults on alpine node8 but seems find on debian.
change out alpine build for a debian build and roll quay build back
to node 6 since it doesn't support multi stage builds
  • Loading branch information
esatterwhite committed Sep 5, 2017
1 parent 55c0adb commit 684c49d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# -- NODE 8
FROM mhart/alpine-node:8 AS base
# -- BASE
FROM buildpack-deps:jessie-curl AS base
ENV storage__path /var/data/skyring
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y \
build-essential curl g++ make tar python

ENV NODE_VERSION 8.4.0

RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz"
RUN tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1

# -- BUILD
FROM base AS build

COPY package*.json /opt/skyring/
WORKDIR /opt/skyring
RUN npm install && mv node_modules prod_node_modules

RUN apk update && \
apk upgrade && \
mkdir -p /var/data/skyring && \
apk add python make g++ git && \
npm install

RUN mv node_modules prod_node_modules

FROM base AS skyring
# -- RELEASE
FROM debian:jessie-slim as skyring
RUN mkdir -p /var/data/skyring
WORKDIR /opt/skyring
VOLUME /etc
VOLUME /var/data/skyring

COPY --from=build /usr/local/bin/node /usr/local/bin/node
COPY --from=build /usr/local/bin/npm /usr/local/bin/npm
COPY --from=build /usr/local/include/node /usr/local/include
COPY --from=build /opt/skyring/prod_node_modules ./node_modules
COPY . .
CMD ["node", "index.js"]
2 changes: 1 addition & 1 deletion quay/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mhart/alpine-node:8
FROM mhart/alpine-node:6
COPY . /opt/skyring
WORKDIR /opt/skyring
RUN apk update && \
Expand Down

0 comments on commit 684c49d

Please sign in to comment.