Skip to content

Commit 0959788

Browse files
committed
chore: add AWS dev tools to the dev container
download installers directly from AWS to ensure we use the latest version. map host credentials folder to the container. set the default AWS profile to use in the dev container to pems.
1 parent 81d3d56 commit 0959788

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,25 @@ RUN pip install --no-cache-dir -r docs/requirements.txt
1010

1111
# install streamlit requirements
1212
RUN pip install --no-cache-dir -r streamlit_app/requirements.txt
13+
14+
# install AWS CLI and Copilot CLI
15+
USER root
16+
# download AWS CLIs to /tmp to avoid write error (23) from curl command
17+
WORKDIR /tmp
18+
RUN HOST_ARCH=$(uname -m) && \
19+
case "$HOST_ARCH" in \
20+
x86_64) HOST_ARCH="amd64" ;; \
21+
aarch64) HOST_ARCH="arm64" ;; \
22+
esac \
23+
&& if [ "$HOST_ARCH" = "amd64" ]; then \
24+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \
25+
elif [ "$HOST_ARCH" = "arm64" ]; then \
26+
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \
27+
fi \
28+
&& unzip awscliv2.zip \
29+
&& ./aws/install \
30+
&& rm -rf aws awscliv2.zip
31+
32+
RUN curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux \
33+
&& chmod +x copilot \
34+
&& mv copilot /usr/local/bin/copilot

.env.sample

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ DJANGO_DB_FIXTURES="pems/local_fixtures.json"
1313
STREAMLIT_LOCAL_PORT=8501
1414
# options: hidden, sidebar
1515
STREAMLIT_NAV=hidden
16+
17+
# AWS
18+
AWS_PROFILE=pems

compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
entrypoint: sleep infinity
2121
volumes:
2222
- ./:/caltrans/app
23+
- ${HOME}/.aws:/caltrans/.aws
2324

2425
docs:
2526
image: caltrans/pems:dev

0 commit comments

Comments
 (0)