Skip to content

Commit cf60622

Browse files
authored
refactor: improve dockerfile using latest binary (#157)
fix: #156
1 parent 0767155 commit cf60622

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

Dockerfile

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
# You should have received a copy of the GNU Affero General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
# Compile
17-
FROM rust:1.63-alpine AS compiler
18-
19-
RUN apk add -q --update-cache --no-cache build-base openssl-dev
16+
FROM alpine:3.14
2017

18+
RUN apk update --quiet \
19+
&& apk add -q --no-cache libgcc curl
20+
2121
# Create appuser
2222
ENV USER=parseable
2323
ENV UID=10001
@@ -31,36 +31,14 @@ RUN adduser \
3131
--uid "${UID}" \
3232
"${USER}"
3333

34-
WORKDIR /parseable
35-
36-
COPY . .
37-
38-
RUN set -eux; \
39-
apkArch="$(apk --print-arch)"; \
40-
if [ "$apkArch" = "aarch64" ]; then \
41-
export JEMALLOC_SYS_WITH_LG_PAGE=16; \
42-
fi && \
43-
cargo build --release
44-
45-
# Run
46-
FROM alpine:3.14
47-
48-
RUN apk update --quiet \
49-
&& apk add -q --no-cache libgcc curl
50-
51-
# add parseable to the `/bin` so you can run it from anywhere and it's easy
52-
# to find.
53-
COPY --from=compiler /etc/passwd /etc/passwd
54-
COPY --from=compiler /etc/group /etc/group
55-
5634
# This directory should hold all the data related to parseable so we're going
5735
# to move our PWD in there.
5836
WORKDIR /parseable
5937

60-
COPY --from=compiler /parseable/target/release/parseable /bin/parseable
38+
ADD https://github.com/parseablehq/parseable/releases/latest/download/parseable_linux_x86_64 /bin/parseable
6139

62-
USER parseable:parseable
40+
USER parseable:parseable
6341

6442
EXPOSE 8000/tcp
6543

66-
CMD ["/bin/parseable"]
44+
CMD ["/bin/parseable"]

0 commit comments

Comments
 (0)