-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.worker
72 lines (57 loc) · 2.16 KB
/
Dockerfile.worker
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
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM rust:1.78-buster as builder
# Install dependencies
RUN apt-get update && apt-get install -y \
libpq-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the worker application code
COPY worker_app /app/worker_app
# Build the worker application
RUN cd worker_app && cargo build --release
# Install FluentCLI
RUN cargo install --force --git https://github.com/njfio/fluent_cli --branch v.0.5.5-feature-docker-image fluent
# Install Amber CLI
RUN cargo install --git https://github.com/fpco/amber amber
# Create necessary directories
RUN mkdir -p /.fluent/state_store /.fluent/example_configurations /.fluent/example_pipelines/ /shared_tmp/state_store
# Copy FluentCLI configuration files
RUN cp /usr/local/cargo/git/checkouts/fluent_cli-*/*/default_config_test.json /.fluent/
RUN cp /usr/local/cargo/git/checkouts/fluent_cli-*/*/amber.yaml /.fluent/
RUN cp /usr/local/cargo/git/checkouts/fluent_cli-*/*/example_configurations/*.json /.fluent/example_configurations/
RUN cp /usr/local/cargo/git/checkouts/fluent_cli-*/*/example_pipelines/*.yaml /.fluent/example_pipelines/
# Final stage
FROM debian:buster-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libpq5 \
openssl \
python3 \
python3-pip \
curl \
bash \
ruby \
iputils-ping \
nano \
net-tools \
jq \
pandoc \
git \
procps \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy binaries and configurations from builder stage
COPY --from=builder /usr/local/cargo/bin/fluent /usr/local/bin/fluent
COPY --from=builder /usr/local/cargo/bin/amber /usr/local/bin/amber
COPY --from=builder /.fluent /.fluent
COPY --from=builder /.fluent/default_config_test.json /app/default_config_test.json
COPY --from=builder /app/worker_app/target/release/worker_app /app/worker_app
# Set environment variables
ENV AMBER_YAML=/.fluent/amber.yaml
ENV FLUENT_STATE_STORE=/shared_tmp/state_store
ENV FLUENT_CLI_V2_CONFIG_PATH=/.fluent/default_config_test.json
ENV AMBER_SECRET=
RUN sed -i 's/"uri": "bolt:\/\/localhost:7687"/"uri": "bolt:\/\/neo4j:7687"/g' /.fluent/default_config_test.json
RUN mkdir -p /shared_tmp
CMD ["/app/worker_app"]