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

LL-317 #92

Merged
merged 15 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:latest
WORKDIR /app
COPY ["package.json", "package-lock.json*", "tsconfig.json*", "/app/"]
COPY ["src", "/app/src"]
RUN ["/bin/bash", "-c", "npm install"]
EXPOSE 4000
108 changes: 79 additions & 29 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,84 @@

version: "3.8"

version: "3"
services:
# account:
# build: "src/account/"
# command: "npm run account"
# ports:
# - "5000:5000"
# env_file: "src/account/.env"
# dns:
# - "8.8.8.8"
models:
build: "src/models/"
command: "echo Models Container Working"
routes:
build: "src/routes/"
command: "npx ts-node github.ts"
activemq:
image: rmohr/activemq
container_name: activemq
networks:
- backend
ports:
- "8161:8161"
- "1883:1883"
env_file: ".env"

# server:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinLemon112 There was a 404 error in all of the user routes because they were not run on the docker compose server. You will need to either uncomment this service or make a new user service to get the user routes to work.

# build: "."
# command: "npm run server"
# ports:
# - "4000:4000"
# networks:
# - backend
# env_file: ".env"
# depends_on:
# - "activemq"
account:
container_name: "account"
build: "src/account/"
command: "npm run account"
ports:
- "5000:5000"
env_file: ".env"
dns:
- "8.8.8.8"
networks:
- backend
publish:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinLemon112 The publish routes weren't working on port 4000, but they work now. You can test by using Postman or a local browser and going to http://localhost:4000/publish/all

You should see something like this:

{
    "id": "all",
    "message": "From Publish Service"
}

container_name: "publish"
build:
context: 'src/notification/publish'
env_file: ".env"
volumes:
- ./src/notification/publish:/app
ports:
- "4000:4000"
- "8080:8080"
env_file: "src/routes/.env"
- 4000:4000
networks:
- backend
depends_on:
- "models"
client:
build: "client/"
command: "npm start"
ports:
- "3000:3000"
env_file: "src/routes/.env"
# Requires server services to run before running client servers
- activemq

subscribe:
container_name: subscribe
build:
context: 'src/notification/subscribe'
env_file: ".env"
volumes:
- ./src/notification/subscribe:/app
networks:
- backend
depends_on:
# - "account"
- "routes"
- activemq
# models:
# build: "src/models/"
# command: "echo Models Container Working"
# routes:
# build: "src/routes/"
# command: "npx ts-node github.ts"
# ports:
# - "4000:4000"
# - "8080:8080"
# env_file: "src/routes/.env"
# depends_on:
# - "models"
# client:
# build: "client/"
# command: "npm start"
# ports:
# - "3000:3000"
# env_file: "src/routes/.env"
# # Requires server services to run before running client servers
# depends_on:
# # - "account"
# - "routes"

networks:
backend:
Loading
Loading