-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (39 loc) · 1.46 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
ARG IMAGE=ubuntu
ARG TAG=22.04
FROM ${IMAGE}:${TAG}
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
LABEL org.opencontainers.image.description "© PremiScale, Inc. 2023"
LABEL org.opencontainers.image.licenses "GPLv3"
LABEL org.opencontainers.image.authors "Emma Doyle <emma@premiscale.com>"
LABEL org.opencontainers.image.documentation "https://premiscale.com"
USER root
ENV AWS_ACCESS_KEY="" \
AWS_REGION="" \
AWS_SECRET_KEY="" \
CRONITOR_TELEMETRY_KEY="" \
DEVELOPMENT_A_RECORD=""
# Install the Doppler CLI via apt for secrets retrieval.
RUN apt-get update \
&& apt-get install -y curl unzip \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd ddns -g 1001 \
&& useradd -rm -d /opt/ddns -s /bin/bash -g ddns -G sudo -u 1001 ddns \
&& mkdir -p /app/terraform \
&& mkdir /app/terraform/.terraform
# Install Terraform
ARG TERRAFORM_VERSION=1.3.4
RUN curl -sOL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
&& install terraform /usr/bin/terraform \
&& rm terraform*.zip
# Install cronitor
RUN curl -sOL https://cronitor.io/dl/linux_amd64.tar.gz \
&& tar xvf linux_amd64.tar.gz -C /usr/bin/ \
&& rm linux_amd64.tar.gz
WORKDIR /app
COPY bin/run.sh .
COPY terraform/* terraform/
RUN chown -R ddns:ddns /app \
&& chmod +x run.sh
USER ddns
CMD [ "./run.sh" ]