Skip to content

Commit

Permalink
dockerfile update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Do committed May 5, 2024
1 parent 355805e commit ff478dd
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit ff478dd

Please sign in to comment.