Skip to content

Commit 859f8ed

Browse files
authored
Chore: add AWS dev tools (#109)
2 parents 81d3d56 + d09d40e commit 859f8ed

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,29 @@ 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 (requires root permissions)
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
35+
36+
# Switch back to non-root user and app directory
37+
USER $USER
38+
WORKDIR /$USER/app

.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:/home/caltrans/.aws
2324

2425
docs:
2526
image: caltrans/pems:dev

0 commit comments

Comments
 (0)