-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |