-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from CAS735-F23/deploy
Deploy
- Loading branch information
Showing
40 changed files
with
552 additions
and
752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use the official Go image as a parent image | ||
FROM golang:1.21.3-bookworm | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install necessary packages and tools | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
curl \ | ||
gnupg \ | ||
software-properties-common | ||
|
||
# Copy the local code to the container's workspace | ||
COPY . /app | ||
|
||
# Install Go dependencies (if applicable) | ||
RUN go mod download | ||
|
||
# Run the application | ||
CMD ./run_tests.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
version: "3.8" | ||
|
||
services: | ||
# RabbitMQ | ||
rabbitmq: | ||
container_name: rabbitmq | ||
image: rabbitmq:management | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
healthcheck: | ||
test: rabbitmq-diagnostics check_port_connectivity | ||
interval: 5s | ||
timeout: 5s | ||
retries: 3 | ||
|
||
# Database | ||
db: | ||
container_name: db | ||
image: postgres:latest | ||
restart: always | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PORT=5432 | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_ENCODING=UTF8 | ||
healthcheck: | ||
test: pg_isready -U postgres | ||
interval: 5s | ||
timeout: 10s | ||
retries: 3 | ||
|
||
# User Manager | ||
user: | ||
container_name: user | ||
build: ../user | ||
restart: always | ||
ports: | ||
- "8010:8010" | ||
environment: | ||
- MODE=prod | ||
- PORT=8010 | ||
- GIN_MODE=release | ||
- POSTGRES_HOST=db | ||
- POSTGRES_PORT=5432 | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_ENCODING=UTF8 | ||
- POSTGRES_LOG_LEVEL=silent | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
rabbitmq: | ||
condition: service_healthy | ||
|
||
|
||
# Zone Manager | ||
zone: | ||
container_name: zone | ||
build: ../zone | ||
restart: always | ||
ports: | ||
- "8011:8011" | ||
environment: | ||
- MODE=prod | ||
- PORT=8011 | ||
- GIN_MODE=release | ||
- POSTGRES_HOST=db | ||
- POSTGRES_PORT=5432 | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_ENCODING=UTF8 | ||
- POSTGRES_LOG_LEVEL=silent | ||
- RABBITMQ_HOSTNAME=rabbitmq | ||
- RABBITMQ_PORT=5672 | ||
- RABBITMQ_USER=guest | ||
- RABBITMQ_PASSWORD=guest | ||
- RABBIT_LOCATION_CONSUMER=location_peripheral_zone_queue | ||
- RABBITMQ_SHELTER_DISTANCE_PUBLISHER=shelter_zone_workout_queue | ||
|
||
depends_on: | ||
db: | ||
condition: service_healthy | ||
rabbitmq: | ||
condition: service_healthy | ||
|
||
# Peripheral Service | ||
peripheral: | ||
container_name: peripheral | ||
build: ../peripheral | ||
restart: always | ||
ports: | ||
- "8012:8012" | ||
environment: | ||
- MODE=prod | ||
- PORT=8012 | ||
- GIN_MODE=release | ||
- RABBITMQ_HOSTNAME=rabbitmq | ||
- RABBITMQ_PORT=5672 | ||
- RABBITMQ_USER=guest | ||
- RABBITMQ_PASSWORD=guest | ||
- RABBIT_WORKOUT_LOCATION_PUBLISHER=location_peripheral_workout_queue | ||
- RABBITMQ_ZONE_LOCATION_PUBLISHER=location_peripheral_zone_queue | ||
- ZONE_CLIENT_URL=http://zone:8011 | ||
depends_on: | ||
rabbitmq: | ||
condition: service_healthy | ||
|
||
|
||
# Workout Manager | ||
workout: | ||
container_name: workout | ||
build: ../workout | ||
restart: always | ||
ports: | ||
- "8013:8013" | ||
environment: | ||
- MODE=prod | ||
- PORT=8013 | ||
- GIN_MODE=release | ||
- POSTGRES_HOST=db | ||
- POSTGRES_PORT=5432 | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_ENCODING=UTF8 | ||
- POSTGRES_LOG_LEVEL=silent | ||
- RABBITMQ_HOSTNAME=rabbitmq | ||
- RABBITMQ_PORT=5672 | ||
- RABBITMQ_USER=guest | ||
- RABBITMQ_PASSWORD=guest | ||
- RABBITMQ_SHELTER_DISTANCE_CONSUMER=shelter_zone_workout_queue | ||
- RABBITMQ_LOCATION_CONSUMER=location_peripheral_workout_queue | ||
- RABBITMQ_WORKOUT_STATS_PUBLISHER=stats_workout_challenge_queue | ||
- USER_CLIENT_URL=http://user:8010 | ||
- PERIPHERAL_CLIENT_URL=http://peripheral:8012 | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
rabbitmq: | ||
condition: service_healthy | ||
peripheral: | ||
condition: service_started | ||
user: | ||
condition: service_started | ||
|
||
|
||
# Challenge Manager | ||
challenge: | ||
container_name: challenge | ||
build: ../challenge | ||
restart: always | ||
ports: | ||
- "8014:8014" | ||
environment: | ||
- MODE=prod | ||
- PORT=8014 | ||
- GIN_MODE=release | ||
- POSTGRES_HOST=db | ||
- POSTGRES_PORT=5432 | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_ENCODING=UTF8 | ||
- POSTGRES_LOG_LEVEL=silent | ||
- RABBITMQ_HOSTNAME=rabbitmq | ||
- RABBITMQ_PORT=5672 | ||
- RABBITMQ_USER=guest | ||
- RABBITMQ_PASSWORD=guest | ||
- RABBITMQ_WORKOUT_STATS_CONSUMER=stats_workout_challenge_queue | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
rabbitmq: | ||
condition: service_healthy |
Oops, something went wrong.