-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mark Do
committed
May 5, 2024
1 parent
355805e
commit ff478dd
Showing
1 changed file
with
11 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,39 +3,27 @@ FROM python:3.11-bookworm | |
# Copy files into container | ||
WORKDIR /app | ||
COPY /src/main.py /app | ||
|
||
# Get ENV vars | ||
ARG S3_SECRET_KEY | ||
ARG SSH_DEPLOY_KEY | ||
ARG S3CFG_CONFIG | ||
|
||
ENV S3CFG_CONFIG=$S3CFG_CONFIG | ||
ENV S3_SECRET_KEY=$S3_SECRET_KEY | ||
ENV SSH_DEPLOY_KEY=$SSH_DEPLOY_KEY | ||
|
||
RUN echo -e "${SSH_DEPLOY_KEY}" | ||
RUN echo $S3_SECRET_KEY | ||
RUN echo S3CFG_CONFIG | ||
COPY /src/run.sh /app | ||
|
||
# Copy the private SSH key from github provisioning to the container | ||
RUN mkdir /root/.ssh/ | ||
RUN echo -e "${SSH_DEPLOY_KEY}" > /root/.ssh/id_rsa | ||
RUN cat /root/.ssh/id_rsa | ||
# RUN mkdir /root/.ssh/ | ||
# RUN echo -e "${SSH_DEPLOY_KEY}" > /root/.ssh/id_rsa | ||
# RUN cat /root/.ssh/id_rsa | ||
# COPY id_rsa /root/.ssh/id_rsa | ||
|
||
# Set permissions for the SSH key | ||
RUN chmod 600 /root/.ssh/id_rsa | ||
# RUN chmod 600 /root/.ssh/id_rsa | ||
|
||
# Add the Git host to the list of known hosts | ||
RUN ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts | ||
# RUN ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts | ||
|
||
# Clone the repository using the deploy key | ||
RUN git clone [email protected]:WATonomous/infra-config.git | ||
# RUN git clone [email protected]:WATonomous/infra-config.git | ||
|
||
# Install s3cmd | ||
RUN pip install s3cmd | ||
COPY s3cfg /app/asset-manager/s3cfg | ||
# RUN pip install s3cmd | ||
|
||
# Run asset-management script | ||
|
||
CMD ["python3", "src/main.py"] | ||
RUN chmod +x run.sh | ||
CMD ["./run.sh"] | ||
# CMD ["echo $PATH"] |