forked from matter-labs-archive/powersoftau
-
Notifications
You must be signed in to change notification settings - Fork 2
/
DockerfileWithCron
49 lines (37 loc) · 1.01 KB
/
DockerfileWithCron
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
FROM rust:1.33-slim
MAINTAINER [email protected]
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
cron \
lftp \
nano \
xxd \
curl \
openssh-server
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Cargo.toml ./
COPY src/. src/.
COPY test/. test/.
#support for sftp
EXPOSE 22
#PID file for storage of cron-pids
#and create config file for validation script
#and create .ssh folder for storage of ssh keys
RUN touch /root/forever.pid \
&& mkdir /app/config \
&& mkdir /root/.ssh
# Add crontab file in the cron directory
ADD tasks/cron-task /etc/cron.d/hello-cron
# Give execution rights on the cron job
# and pply cron job
# and create the log file to be able to run tail
RUN chmod 0644 /etc/cron.d/hello-cron \
&& crontab /etc/cron.d/hello-cron \
&& touch /var/log/cron.log
#Copy env variables folder for cron job
COPY variables.sh ./
#COPY scripts to docker
COPY scripts/. scripts/.
RUN sh scripts/build_all.sh
# Run the command on container startup
CMD ["cron", "-f"]