Skip to content

Commit

Permalink
add initial v2 services with aws sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
austinlparker committed Apr 2, 2024
1 parent 823fd1b commit b6c3ee3
Show file tree
Hide file tree
Showing 21 changed files with 12,272 additions and 15 deletions.
55 changes: 51 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,64 @@
"version": "0.2.0",
"configurations": [
{
"name": "boogers",
"name": "backend-for-frontend-local",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/services/meminator",
"cwd": "${workspaceRoot}/services/backend-for-frontend-nodejs",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"args": ["${workspaceRoot}/services/backend-for-frontend-nodejs/src/index.ts"]
},
{
"name": "image-picker-local",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/services/image-picker-v2-nodejs",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"env": {
"PORT": "10115"
},
"args": ["${workspaceRoot}/services/image-picker-v2-nodejs/src/index.ts"]
},
{
"name": "phrase-picker-local",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/services/phrase-picker-nodejs",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"args": ["${workspaceRoot}/services/phrase-picker-nodejs/src/index.ts"]
},
{
"name": "meminator-local",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}/services/meminator-v2-nodejs",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"env": {
"PORT": "10117"
},
"args": [
"${workspaceRoot}/services/meminator/src/index.ts"
"${workspaceRoot}/services/meminator-v2-nodejs/src/index.ts"
]
}
},
],
"compounds": [
{
"name": "Local Backend",
"configurations": ["backend-for-frontend-local", "image-picker-local", "phrase-picker-local", "meminator-local"],
"preLaunchTask": "${defaultBuildTask}",
"stopAll": true
}
]
}
103 changes: 103 additions & 0 deletions docker-compose-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
version: '3'

services:
backend-for-frontend:
build:
context: services/backend-for-frontend-${PROGRAMMING_LANGUAGE}
dockerfile: Dockerfile
# platforms:
# # this is useful for pushing to Dockerhub, not for local builds
# - linux/amd64
# - linux/arm64
cache_from:
- ${IMAGE_REPO_USER}/backend-for-frontend-${PROGRAMMING_LANGUAGE}:${IMAGE_VERSION}
image: ${IMAGE_REPO_USER}/backend-for-frontend-${PROGRAMMING_LANGUAGE}:${WORKSHOP_VERSION}
ports:
- "10115:10114" # Expose the port your Express app is listening on
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_SERVICE_NAME=backend-for-frontend-${PROGRAMMING_LANGUAGE}

meminator:
build:
context: services/meminator-v2-${PROGRAMMING_LANGUAGE}
dockerfile: Dockerfile
# platforms:
# - linux/amd64
# - linux/arm64
cache_from:
- ${IMAGE_REPO_USER}/meminator-${PROGRAMMING_LANGUAGE}:${IMAGE_VERSION}
image: ${IMAGE_REPO_USER}/meminator-${PROGRAMMING_LANGUAGE}:${WORKSHOP_VERSION}
ports:
- "10116:10114" # they can't be the same
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_SERVICE_NAME=meminator-${PROGRAMMING_LANGUAGE}
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

phrase-picker:
build:
context: services/phrase-picker-${PROGRAMMING_LANGUAGE}
dockerfile: Dockerfile
# platforms:
# - linux/amd64
# - linux/arm64
cache_from:
- ${IMAGE_REPO_USER}/phrase-picker-${PROGRAMMING_LANGUAGE}:${IMAGE_VERSION}
image: ${IMAGE_REPO_USER}/phrase-picker-${PROGRAMMING_LANGUAGE}:${WORKSHOP_VERSION}
ports:
- "10117:10114" # the outer ports can't be the same
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_SERVICE_NAME=phrase-picker-${PROGRAMMING_LANGUAGE}

image-picker:
build:
context: services/image-picker-v2-${PROGRAMMING_LANGUAGE}
dockerfile: Dockerfile
# platforms:
# - linux/amd64
# - linux/arm64
cache_from:
- ${IMAGE_REPO_USER}/image-picker-${PROGRAMMING_LANGUAGE}:${IMAGE_VERSION}
image: ${IMAGE_REPO_USER}/image-picker-${PROGRAMMING_LANGUAGE}:${WORKSHOP_VERSION}
ports:
- "10118:10114" # the outer ports can't be the same
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_SERVICE_NAME=image-picker-${PROGRAMMING_LANGUAGE}
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

web:
build:
context: services/web
dockerfile: Dockerfile
args:
HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
# platforms:
# - linux/amd64
# - linux/arm64
cache_from:
- ${IMAGE_REPO_USER}/web:${IMAGE_VERSION}
image: ${IMAGE_REPO_USER}/web:${WORKSHOP_VERSION}
# volumes: # uncomment this for faster development on the frontend
# - ./services/web/dist:/usr/share/nginx/html # Mount directory containing static files -- only do this for development
ports:
- "8080:80" # Expose port 8080 for Nginx

otel-collector:
image: otel/opentelemetry-collector-contrib:0.96.0
ports:
- "4317:4317" # OpenTelemetry gRPC
- "4318:4318" # OpenTelemetry HTTP
volumes:
- ./services/otel-collector/otel-collector-config.yaml:/etc/otel-collector-config.yaml
command: [ "--config=/etc/otel-collector-config.yaml" ]
environment:
- HONEYCOMB_API_KEY
Loading

0 comments on commit b6c3ee3

Please sign in to comment.