Skip to content

Commit

Permalink
[CI]: Update container images (#238)
Browse files Browse the repository at this point in the history
* [CI]: Update container images

* moved pctasks-frontend to an aux server
* shrink container images a bit
  • Loading branch information
Tom Augspurger authored Jul 17, 2023
1 parent 9f95843 commit 5227f1d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 20 deletions.
6 changes: 4 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ ENV LANG=C.UTF-8

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update && apt-get install -y software-properties-common
RUN apt-get update && apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*

RUN add-apt-repository ppa:ubuntugis/ppa && \
apt-get update && \
apt-get install -y build-essential python3-dev python3-pip \
jq unzip ca-certificates wget curl && \
apt-get autoremove && apt-get autoclean && apt-get clean
apt-get autoremove && apt-get autoclean && apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10

Expand Down
1 change: 1 addition & 0 deletions Dockerfile.task_base
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV TZ=UTC

ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV PIP_NO_CACHE_DIR=1

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

Expand Down
16 changes: 16 additions & 0 deletions docker-compose.aux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ services:
ports:
- "8514:8080"

frontend:
container_name: pctasks-frontend-app
image: node:16.16-slim
working_dir: /usr/src/app
env_file:
- "pctasks_frontend/.env"
ports:
- "8515:8515"
environment:
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_INTERVAL=100
- REACT_APP_DEV_AUTH_TOKEN=${REACT_APP_DEV_AUTH_TOKEN:-hunter2}
volumes:
- ./pctasks_frontend:/usr/src/app
command: "npm start"

networks:
default:
# Network created during scripts/setup
Expand Down
16 changes: 0 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,6 @@ services:
"--proxy-headers"
]

frontend:
container_name: pctasks-frontend-app
image: node:16.16-slim
working_dir: /usr/src/app
env_file:
- "pctasks_frontend/.env"
ports:
- "8515:8515"
environment:
- CHOKIDAR_USEPOLLING=true
- CHOKIDAR_INTERVAL=100
- REACT_APP_DEV_AUTH_TOKEN=${REACT_APP_DEV_AUTH_TOKEN:-hunter2}
volumes:
- ./pctasks_frontend:/usr/src/app
command: "npm start"

# Used to let kind cluster pull local docker images
# See https://kind.sigs.k8s.io/docs/user/local-registry/
local-docker-registry:
Expand Down
2 changes: 1 addition & 1 deletion docs/development/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ to inspect ingest results, and the frontend.
| STAC API | <http://localhost:8513> |
| STAC Browser | <http://localhost:8514> |

You can avoid building or bringing up the STAC API and STAC Browser
You can avoid building or bringing up the frontend, STAC API, and STAC Browser
servers by using the flag `--no-aux-servers` in `scripts/setup`,
`scripts/update`, and `scripts/server`. This can save on build time
and memory footprint if you are not using those services.
Expand Down
8 changes: 8 additions & 0 deletions pctasks/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
**/.envrc
**/.direnv
**/__pycache__
**/.mypy_cache
**/.pytest_cache
**/.terraform
**/node_modules
**/.terraform
1 change: 1 addition & 0 deletions pctasks/run/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN apt-get update && \
apt-get install -y build-essential git

ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
ENV PIP_NO_CACHE_DIR=1

WORKDIR /opt/src

Expand Down
4 changes: 3 additions & 1 deletion pctasks/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ FROM python:3.9-slim
ARG DEVELOPMENT=FALSE

RUN apt-get update && \
apt-get install -y build-essential git
apt-get install -y build-essential git && \
rm -rf /var/lib/apt/lists/*

ENV CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
ENV PIP_NO_CACHE_DIR=1

WORKDIR /opt/src

Expand Down
1 change: 1 addition & 0 deletions scripts/update
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ while [[ $# -gt 0 ]]; do case $1 in
;;
--no-aux-servers)
BUILD_AUX_SERVERS=""
BUILD_FRONTEND=""
shift
;;
--task)
Expand Down

0 comments on commit 5227f1d

Please sign in to comment.