Added Dockerfile

This commit is contained in:
Jonathan Knapp 2018-08-02 14:22:12 -07:00 committed by Jonathan Knapp
parent 4b04d9a2f9
commit 9bdb170000
2 changed files with 31 additions and 0 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
.git
node_modules

29
Dockerfile Normal file
View file

@ -0,0 +1,29 @@
FROM base/archlinux:latest AS base
RUN mkdir -p /code
WORKDIR /code
CMD "hsd"
RUN pacman -Sy --noconfirm archlinux-keyring && \
pacman -Syu --noconfirm nodejs unbound && \
rm /var/cache/pacman/pkg/*
COPY package.json \
#package-lock.json \
/code/
FROM base AS build
# Install build dependencies
RUN pacman -Syu --noconfirm base-devel unrar git python2 npm
#HACK: Node-gyp needs python
RUN ln -s /usr/bin/python2 /usr/bin/python
# Install hsd
RUN npm install --production
FROM base
ENV PATH="${PATH}:/code/bin:/code/node_modules/.bin"
COPY --from=build /code/node_modules /code/node_modules/
COPY bin /code/bin/
COPY lib /code/lib/