Skip to content

Commit

Permalink
Updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
couling committed Feb 4, 2022
1 parent 463c410 commit 8c965a0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM alpine:latest AS base
ARG version
ARG pip_extra=""
RUN apk add --no-cache python3 py3-pip py3-wheel
# pip_extra allows use of --pre and test pypi for build purposes

RUN pip install --no-cache-dir ${pip_extra} hashback[server]==${version}
COPY docs/examples/basic-server.json /etc/hashback/basic-server.json
RUN hashback-db-admin /data create
RUN --mount=type=cache,sharing=locked,target=/var/cache/apk \
apk add python3 py3-pip py3-wheel

FROM base as build
COPY /dist/ /hashback/

RUN apk add git
FROM base as final

RUN --mount=type=cache,sharing=locked,target=/root/.cache \
--mount=type=bind,from=build,source=/hashback/,target=/mnt \
file=$(ls -1 /mnt) ; pip install /mnt/${file}[server]

COPY / /app

RUN pip install -e /app[server]
COPY docs/examples/basic-server.json /etc/hashback/basic-server.json
RUN hashback-db-admin /data create

VOLUME /data
VOLUME /etc/hashback

0 comments on commit 8c965a0

Please sign in to comment.