-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (33 loc) · 1.98 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
# This creates a temp image simulating an Ubuntu EC2 to test the installer script
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
# Add sudo to make more like EC2 instance
RUN apt-get update && apt-get install -y software-properties-common python3 python3-pip sudo locales vim
# EC2 instances usually have locale settings
RUN locale-gen en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Needed to allow crons to run in the container
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
# Use non-root user (Docker by default uses root)
RUN useradd -ms /bin/bash ubuntu && \
echo "ubuntu ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ubuntu && \
chmod 0440 /etc/sudoers.d/ubuntu
USER ubuntu
WORKDIR /home/ubuntu
# Shortcuts for docker-compose actions
RUN echo 'alias dc="docker-compose"' >> ~/.bashrc
RUN echo 'alias logs="docker-compose -f /home/ubuntu/deployment/docker-compose.yml logs"' >> ~/.bashrc
RUN echo 'alias n-logs="docker-compose -f /home/ubuntu/deployment/docker-compose.yml logs nginx"' >> ~/.bashrc
RUN echo 'alias ms-logs="docker-compose -f /home/ubuntu/deployment/docker-compose.yml logs ethereum-reader"' >> ~/.bashrc
RUN echo 'alias ew-logs="docker-compose -f /home/ubuntu/deployment/docker-compose.yml logs ethereum-writer"' >> ~/.bashrc
RUN echo 'alias s-logs="docker-compose -f /home/ubuntu/deployment/docker-compose.yml logs signer"' >> ~/.bashrc
RUN echo 'alias ms-exec="docker-compose -f /home/ubuntu/deployment/docker-compose.yml exec ethereum-reader sh"' >> ~/.bashrc
RUN echo 'alias ew-exec="docker-compose -f /home/ubuntu/deployment/docker-compose.yml exec ethereum-writer sh"' >> ~/.bashrc
RUN echo 'alias s-exec="docker-compose -f /home/ubuntu/deployment/docker-compose.yml exec signer sh"' >> ~/.bashrc
COPY --chown=ubuntu:ubuntu setup setup
COPY --chown=ubuntu:ubuntu manager manager
COPY --chown=ubuntu:ubuntu deployment deployment
COPY --chown=ubuntu:ubuntu logging logging
CMD ["/bin/bash"]