-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
52 lines (41 loc) · 1.7 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM debian:bookworm-slim AS builder
ENV COUCHDB_VERSION=3.4.2
ENV NODEVERSION=22
# Prepare build env
RUN apt-get update && apt-get install -y git
RUN git clone --depth 1 https://github.com/apache/couchdb-ci.git
# For couchdb-ci compatability
RUN adduser jenkins
RUN bash /couchdb-ci/bin/install-dependencies.sh
RUN apt-get install -y libmozjs-78-dev
# Build CouchDB
WORKDIR /
RUN git clone --depth 1 --branch $COUCHDB_VERSION https://github.com/apache/couchdb.git
WORKDIR /couchdb
RUN ./configure --disable-docs --spidermonkey-version 78
# workaround chromedriver not supporting armv7
RUN sed -i 's/npm install/npm uninstall chromedriver \&\& npm install/g' Makefile
RUN make release
FROM debian:bookworm-slim
COPY --from=builder /couchdb/rel/couchdb /opt/couchdb
COPY --chown=couchdb:couchdb 10-docker-default.ini /opt/couchdb/etc/default.d/
COPY --chown=couchdb:couchdb vm.args /opt/couchdb/etc/
COPY docker-entrypoint.sh /usr/local/bin
RUN groupadd -g 5984 -r couchdb && useradd -u 5984 -d /opt/couchdb -g couchdb couchdb; \
chown -R couchdb:couchdb /opt/couchdb; \
find /opt/couchdb -type d -exec chmod 0770 {}; \
chmod 0644 /opt/couchdb/etc/*; \
chmod +x /usr/local/bin/docker-entrypoint.sh
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends tini erlang-nox libicu72 libmozjs-78-dev; \
rm -rf /var/lib/apt/lists/*; \
tini --version
RUN ln -s usr/local/bin/docker-entrypoint.sh /docker-entrypoint.sh # backwards compat
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
VOLUME /opt/couchdb/data
# 5984: Main CouchDB endpoint
# 4369: Erlang portmap daemon (epmd)
# 9100: CouchDB cluster communication port
EXPOSE 5984 4369 9100
CMD ["/opt/couchdb/bin/couchdb"]