Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
Brijeshthummar02 committed Jan 28, 2025
1 parent 6248c11 commit f5d4a11
Show file tree
Hide file tree
Showing 14 changed files with 2,486 additions and 0 deletions.
1 change: 1 addition & 0 deletions result/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
25 changes: 25 additions & 0 deletions result/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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/*

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 /usr/local/app/node_modules /node_modules

COPY . .

ENV PORT 80
EXPOSE 80

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["node", "server.js"]
62 changes: 62 additions & 0 deletions result/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: '2'

services:

sut:
build: ./tests/
depends_on:
- vote
- result
- worker
networks:
- front-tier

vote:
build: ../vote/
ports: ["80"]
depends_on:
- redis
- db
networks:
- front-tier
- back-tier

result:
build: .
ports: ["80"]
depends_on:
- redis
- db
networks:
- front-tier
- back-tier

worker:
build: ../worker/
depends_on:
- redis
- db
networks:
- back-tier

redis:
image: redis:alpine
networks:
- back-tier

db:
image: postgres:9.4
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
volumes:
- "db-data:/var/lib/postgresql/data"
networks:
- back-tier

volumes:
db-data:

networks:
front-tier:
back-tier:
Loading

0 comments on commit f5d4a11

Please sign in to comment.