Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr #325

Open
wants to merge 10 commits into
base: scout-fix
Choose a base branch
from
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Note: Results debugger",
"type": "node",
"request": "attach",
"port": 9229,
"address": "localhost",
"skipFiles": [
"<node_internals>/**"
],
"remoteRoot": "/app",
"localRoot": "${workspaceFolder}/result"
}
]
}
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

services:
vote:
build: ./vote
# use python rather than gunicorn for local dev
command: python app.py
build:
context: ./vote
target: dev
depends_on:
redis:
condition: service_healthy
Expand All @@ -17,7 +17,7 @@ services:
retries: 3
start_period: 10s
volumes:
- ./vote:/app
- ./vote:/usr/local/app
ports:
- "5000:80"
networks:
Expand All @@ -27,15 +27,15 @@ services:
result:
build: ./result
# use nodemon rather than node for local dev
entrypoint: nodemon server.js
entrypoint: nodemon --inspect=0.0.0.0 server.js
depends_on:
db:
condition: service_healthy
volumes:
- ./result:/app
- ./result:/usr/local/app
ports:
- "5001:80"
- "5858:5858"
- "127.0.0.1:9229:9229"
networks:
- front-tier
- back-tier
Expand Down
16 changes: 7 additions & 9 deletions result/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM node:18-slim

# add curl for healthcheck
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
tini \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y --no-install-recommends curl tini && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app
WORKDIR /usr/local/app

# have nodemon available for local dev use (file watching)
RUN npm install -g nodemon

COPY package*.json ./

RUN npm ci \
&& npm cache clean --force \
&& mv /app/node_modules /node_modules
RUN npm ci && \
npm cache clean --force && \
mv /usr/local/app/node_modules /node_modules

COPY . .

Expand Down
Loading