Skip to content

Commit

Permalink
Merge branch 'main' into sage-monorepo/create-node-lambda-template
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaffter committed Dec 3, 2024
2 parents 7caa3d1 + 56262b4 commit 1dda86c
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Sage Dev Container",
"image": "ghcr.io/sage-bionetworks/sage-devcontainer:fb4a44a",
"image": "ghcr.io/sage-bionetworks/sage-devcontainer:fab0893",
"containerEnv": {
"NX_BASE": "${localEnv:NX_BASE}",
"NX_BRANCH": "${localEnv:NX_BRANCH}",
Expand Down
31 changes: 31 additions & 0 deletions apps/openchallenges/apex/Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
debug
}

:80 {
handle_path /api-docs* {
reverse_proxy {env.API_DOCS_HOST}:{env.API_DOCS_PORT}
}

handle_path /api* {
reverse_proxy {env.API_GATEWAY_HOST}:{env.API_GATEWAY_PORT}
}

handle_path /health {
respond `{"status":"healthy"}` 200
header Content-Type application/json
}

handle_path /img* {
reverse_proxy {env.THUMBOR_HOST}:{env.THUMBOR_PORT}
}

handle_path /zipkin* {
rewrite * /zipkin{uri}
reverse_proxy {env.ZIPKIN_HOST}:{env.ZIPKIN_PORT}
}

handle {
reverse_proxy {env.APP_HOST}:{env.APP_PORT}
}
}
13 changes: 4 additions & 9 deletions apps/openchallenges/apex/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
FROM nginx:1.25.1-alpine
FROM caddy:2.8.4

RUN apk add --no-cache jq
RUN apk add --no-cache curl jq

HEALTHCHECK --interval=2s --timeout=3s --retries=20 --start-period=5s \
CMD curl --fail --silent "localhost:8000/health" | jq '.status' | grep UP || exit 1
CMD curl --fail --silent "localhost:80/health" | jq '.status' | grep healthy || exit 1

COPY templates /etc/nginx/templates/
COPY nginx.conf /etc/nginx/

EXPOSE 8000

CMD ["nginx", "-g", "daemon off;"]
COPY Caddyfile /etc/caddy/
8 changes: 0 additions & 8 deletions apps/openchallenges/apex/README.md

This file was deleted.

8 changes: 0 additions & 8 deletions apps/openchallenges/apex/nginx.conf

This file was deleted.

8 changes: 3 additions & 5 deletions apps/openchallenges/apex/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "openchallenges-apex",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/openchallenges-apex/src",
"projectType": "application",
"targets": {
"create-config": {
Expand All @@ -14,17 +13,16 @@
"serve-detach": {
"executor": "nx:run-commands",
"options": {
"command": "docker/openchallenges/serve-detach.sh openchallenges-apex"
"command": "docker/openchallenges/serve-detach.sh {projectName}"
}
},
"scan-image": {
"executor": "nx:run-commands",
"options": {
"command": "trivy image ghcr.io/sage-bionetworks/openchallenges-apex:local --quiet",
"command": "trivy image ghcr.io/sage-bionetworks/{projectName}:local --quiet",
"color": true
}
}
},
"tags": ["type:service", "scope:backend"],
"implicitDependencies": []
"tags": ["type:service", "scope:backend"]
}
3 changes: 0 additions & 3 deletions apps/openchallenges/apex/templates/events.conf.template

This file was deleted.

118 changes: 0 additions & 118 deletions apps/openchallenges/apex/templates/http.conf.template

This file was deleted.

8 changes: 3 additions & 5 deletions docker/openchallenges/services/apex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ services:
restart: always
env_file:
- ../../../apps/openchallenges/apex/.env
# volumes:
# - ../../../apps/openchallenges/apex/nginx.conf:/etc/nginx/nginx.conf
# - ../../../apps/openchallenges/apex/templates:/etc/nginx/templates
volumes:
- ../../../apps/openchallenges/apex/Caddyfile:/etc/caddy/Caddyfile
networks:
- openchallenges
ports:
- '8000:8000'
- '8000:80'
depends_on:
openchallenges-api-docs:
condition: service_healthy
Expand All @@ -21,7 +20,6 @@ services:
condition: service_started
openchallenges-zipkin:
condition: service_healthy

deploy:
resources:
limits:
Expand Down
7 changes: 7 additions & 0 deletions tools/devcontainers/sage/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ RUN curl -fsSL https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscl
&& dpkg -i /tmp/session-manager-plugin.deb \
&& rm -fr /tmp/session-manager-plugin.deb

# Install AWS SAM CLI
RUN curl -Lo aws-sam-cli-linux-x86_64.zip https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip \
&& unzip aws-sam-cli-linux-x86_64.zip -d sam-installation \
&& ./sam-installation/install \
&& rm -rf aws-sam-cli-linux-x86_64.zip sam-installation \
&& sam --version

# Install the devcontainer CLI
RUN npm install -g "@devcontainers/cli@${devcontainerCliVersion}"

Expand Down

0 comments on commit 1dda86c

Please sign in to comment.