Skip to content

Commit 7460d24

Browse files
committed
[WIP] more dockerfile for play
1 parent 728e095 commit 7460d24

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

play/Dockerfile

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ ENV BASH_ENV=/home/app/.env
77
RUN groupadd -g 1000 app && \
88
useradd -g 1000 -u 1000 -m app
99

10-
RUN apt update && \
10+
RUN --mount=type=cache,target=/var/cache/apt \
11+
apt update && \
1112
apt install -y git curl
1213

1314
USER 1000
@@ -22,7 +23,8 @@ FROM base AS build
2223

2324
USER root
2425

25-
RUN apt install -y build-essential libreadline-dev zlib1g-dev libssl-dev libuuid1 uuid-dev unzip
26+
RUN --mount=type=cache,target=/var/cache/apt \
27+
apt install -y build-essential libreadline-dev zlib1g-dev libssl-dev libuuid1 uuid-dev unzip
2628

2729
COPY ./ /src
2830

@@ -31,29 +33,15 @@ USER 1000
3133

3234
WORKDIR /src/rolling-shutter
3335

34-
RUN make install-asdf && \
36+
RUN --mount=type=cache,target=/home/app/.asdf/downloads,uid=1000,gid=1000 \
37+
--mount=type=cache,target=/home/app/.asdf/tmp,uid=1000,gid=1000 \
38+
make install-asdf
39+
40+
RUN --mount=type=cache,target=/home/app/.asdf/downloads,uid=1000,gid=1000 \
41+
--mount=type=cache,target=/home/app/.asdf/tmp,uid=1000,gid=1000 \
42+
--mount=type=cache,target=/home/app/.cache/go-build,uid=1000,gid=1000 \
43+
make install-asdf && \
3544
make install-tools && \
3645
make build
3746

38-
RUN go clean -cache -modcache
39-
40-
FROM base AS run
41-
42-
USER root
43-
RUN apt install make
44-
45-
USER 1000
46-
RUN mkdir /home/app/.asdf/installs
47-
COPY --from=build /src /src
48-
COPY --from=build /home/app/.asdf/plugins/ /home/app/.asdf/plugins/
49-
COPY --from=build /home/app/.asdf/installs/babashka/ /home/app/.asdf/installs/babashka/
50-
COPY --from=build /home/app/.asdf/installs/clojure/ /home/app/.asdf/installs/clojure/
51-
COPY --from=build /home/app/.asdf/installs/golang/ /home/app/.asdf/installs/golang/
52-
COPY --from=build /home/app/.asdf/installs/java/ /home/app/.asdf/installs/java/
53-
COPY --from=build /home/app/.asdf/installs/nodejs/ /home/app/.asdf/installs/nodejs/
54-
COPY --from=build /home/app/.asdf/installs/postgres/ /home/app/.asdf/installs/postgres/
55-
COPY --from=build /home/app/.asdf/installs/solidity/ /home/app/.asdf/installs/solidity/
56-
RUN asdf reshim
57-
58-
5947
WORKDIR /src

0 commit comments

Comments
 (0)