forked from fonoster/fonoster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
59 lines (50 loc) · 1.71 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
53
54
55
56
57
58
59
##
## Dependencies
##
FROM fonoster/base AS deps
WORKDIR /work
LABEL maintainer="Pedro Sanders <[email protected]>"
# Install dependencies and set permissions
RUN apk add --no-cache --update git curl docker docker-compose openssl bash \
&& curl -qL -o /usr/bin/netdiscover https://github.com/CyCoreSystems/netdiscover/releases/download/v1.2.5/netdiscover.linux.amd64 \
&& chmod +x /usr/bin/netdiscover \
&& curl -qL -o /usr/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver \
&& chmod +x /usr/bin/semver
##
## Stage
##
FROM deps AS stage
WORKDIR /work
# Copy relevant files
COPY . /work/fonoster
# Copy configuration files
RUN mkdir -p docker operator config \
&& touch config/config config/user_credentials \
&& cp -r fonoster/docker . \
&& cp -a fonoster/operator/compose/* operator \
&& mv operator/env_example operator/.env \
&& cp fonoster/etc/rbac.json config \
&& cp fonoster/etc/limiters.json config \
&& cp fonoster/etc/log4j2.yml config \
&& cp fonoster/etc/bootstrap.yml config \
&& cp fonoster/etc/redis.conf config \
&& cp fonoster/etc/fluent.conf config \
&& cp fonoster/etc/service_envs.json config \
&& cp fonoster/etc/install.sh . \
&& cp fonoster/etc/update.sh . \
&& cp fonoster/etc/stop.sh . \
&& rm -rf fonoster
##
## Serve
##
FROM stage AS serve
WORKDIR /work
COPY --from=stage /work/install.sh /work/update.sh /work/stop.sh ./
COPY --from=stage /work/docker /work/docker
RUN find . -type f -iname "*.sh" -exec chmod +x {} + \
&& mv /work/install.sh /install.sh \
&& mv /work/update.sh /update.sh \
&& mv /work/stop.sh /stop.sh \
&& mv /work/docker /docker \
&& chown -R fonoster:fonoster /work
ENTRYPOINT [ "/install.sh" ]