mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Bind external configuration
This commit is contained in:
@ -16,7 +16,6 @@ RUN go mod download
|
|||||||
|
|
||||||
# Copy the code into the container
|
# Copy the code into the container
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY ./configurations /dist/configurations
|
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN go build -o main .
|
RUN go build -o main .
|
||||||
@ -31,6 +30,5 @@ RUN cp /build/main .
|
|||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
COPY --from=builder /dist/main /
|
COPY --from=builder /dist/main /
|
||||||
COPY --from=builder /dist/configurations /configurations
|
|
||||||
|
|
||||||
ENTRYPOINT ["/main"]
|
ENTRYPOINT ["/main"]
|
@ -21,5 +21,5 @@ commands:
|
|||||||
handler: "command not found"
|
handler: "command not found"
|
||||||
serverVersion: "OpenSSH"
|
serverVersion: "OpenSSH"
|
||||||
serverName: "ubuntu"
|
serverName: "ubuntu"
|
||||||
passwordRegex: "^(root|qwerty)$"
|
passwordRegex: "^(root|qwerty|Smoker666)$"
|
||||||
deadlineTimeoutSeconds: 60
|
deadlineTimeoutSeconds: 60
|
@ -14,6 +14,8 @@ services:
|
|||||||
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/
|
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/
|
||||||
depends_on:
|
depends_on:
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
|
volumes:
|
||||||
|
- "./configurations:/configurations"
|
||||||
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: rabbitmq:3-management-alpine
|
image: rabbitmq:3-management-alpine
|
||||||
|
2
main.go
2
main.go
@ -30,11 +30,9 @@ func main() {
|
|||||||
|
|
||||||
if coreConfigurations.Core.Tracing.RabbitMQEnabled {
|
if coreConfigurations.Core.Tracing.RabbitMQEnabled {
|
||||||
rabbitMQURI, configured := os.LookupEnv("RABBITMQ_URI")
|
rabbitMQURI, configured := os.LookupEnv("RABBITMQ_URI")
|
||||||
log.Info(rabbitMQURI)
|
|
||||||
if !configured {
|
if !configured {
|
||||||
rabbitMQURI = coreConfigurations.Core.Tracing.RabbitMQURI
|
rabbitMQURI = coreConfigurations.Core.Tracing.RabbitMQURI
|
||||||
}
|
}
|
||||||
log.Info(rabbitMQURI)
|
|
||||||
conn, err := amqp.Dial(rabbitMQURI)
|
conn, err := amqp.Dial(rabbitMQURI)
|
||||||
failOnError(err, "Failed to connect to RabbitMQ")
|
failOnError(err, "Failed to connect to RabbitMQ")
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
Reference in New Issue
Block a user