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

Re-organize repository #260

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
build-init:
docker buildx create --platform linux/arm/v7,linux/amd64 --use --name multiarch

build-cadence:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence:latest --tag kenellorando/cadence:$(VERSION) --file ./cadence/cadence.Dockerfile ./cadence/
build-cadence_api:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag "kenellorando/cadence_api:latest" --tag kenellorando/cadence_api:$(VERSION) --file ./src/cadence-api.Dockerfile ./src/

# build-cadence_api:
# docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag "kenellorando/cadence:latest" --tag kenellorando/cadence:$(VERSION) --file ./src/cadence.Dockerfile ./src/

build-cadence_icecast2:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_icecast2:latest --tag kenellorando/cadence_icecast2:$(VERSION) --file ./cadence/icecast2.Dockerfile ./cadence/
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_icecast2:latest --tag kenellorando/cadence_icecast2:$(VERSION) --file ./src/icecast2.Dockerfile ./src/

build-cadence_liquidsoap:
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_liquidsoap:latest --tag kenellorando/cadence_liquidsoap:$(VERSION) --file ./cadence/liquidsoap.Dockerfile ./cadence/
docker buildx build --push --platform linux/arm/v7,linux/amd64 --tag kenellorando/cadence_liquidsoap:latest --tag kenellorando/cadence_liquidsoap:$(VERSION) --file ./src/liquidsoap.Dockerfile ./src/

build-all: build-cadence build-cadence_icecast2 build-cadence_liquidsoap
build-all: build-cadence_api build-cadence_icecast2 build-cadence_liquidsoap
2 changes: 1 addition & 1 deletion config/cadence.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ POSTGRES_PASSWORD=CADENCE_PASS_EXAMPLE
# Development
CSERVER_DEVMODE=0
CSERVER_VERSION=5.4.3
CSERVER_ROOTPATH=/cadence/server/
CSERVER_ROOTPATH=/cadence/api/

# Service Addresses
CSERVER_PORT=:8080
Expand Down
4 changes: 2 additions & 2 deletions config/nginx.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ http {
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_pass http://cadence:8080/api/radiodata/sse;
proxy_pass http://cadence-api:8080/api/radiodata/sse;
}
location / {
proxy_pass http://cadence:8080/;
proxy_pass http://cadence-api:8080/;
}
}
}
16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:

icecast2:
build:
dockerfile: ./cadence/icecast2.Dockerfile
dockerfile: ./src/icecast2.Dockerfile
image: kenellorando/cadence_icecast2:latest
container_name: icecast2
restart: always
Expand All @@ -35,7 +35,7 @@ services:

liquidsoap:
build:
dockerfile: ./cadence/liquidsoap.Dockerfile
dockerfile: ./src/liquidsoap.Dockerfile
image: kenellorando/cadence_liquidsoap:latest
container_name: liquidsoap
restart: always
Expand All @@ -50,12 +50,12 @@ services:
internal_services:
stream_delivery:

cadence:
cadence-api:
build:
context: ./cadence
dockerfile: ./cadence.Dockerfile
image: kenellorando/cadence
container_name: cadence
context: ./src
dockerfile: ./cadence-api.Dockerfile
image: kenellorando/cadence-api
container_name: cadence-api
restart: always
ports:
- 8080:8080
Expand All @@ -81,7 +81,7 @@ services:
ports:
- 80:80
depends_on:
- cadence
- cadence-api
networks:
external_services:

Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:

icecast2:
build:
dockerfile: ./cadence/icecast2.Dockerfile
dockerfile: ./src/icecast2.Dockerfile
image: kenellorando/cadence_icecast2:latest
container_name: icecast2
restart: always
Expand All @@ -35,7 +35,7 @@ services:

liquidsoap:
build:
dockerfile: ./cadence/liquidsoap.Dockerfile
dockerfile: ./src/liquidsoap.Dockerfile
image: kenellorando/cadence_liquidsoap:latest
container_name: liquidsoap
restart: always
Expand All @@ -50,19 +50,19 @@ services:
internal_services:
stream_delivery:

cadence:
cadence-api:
build:
context: ./cadence
dockerfile: ./cadence.Dockerfile
image: kenellorando/cadence
container_name: cadence
context: ./src
dockerfile: ./cadence-api.Dockerfile
image: kenellorando/cadence-api
container_name: cadence-api
restart: always
ports:
- 8080:8080
env_file:
- ./config/cadence.env
volumes:
- CADENCE_PATH_EXAMPLE:CADENCE_PATH_EXAMPLE
- /music:/music
depends_on:
- icecast2
- liquidsoap
Expand All @@ -81,7 +81,7 @@ services:
ports:
- 80:80
depends_on:
- cadence
- cadence-api
networks:
external_services:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions cadence/cadence.Dockerfile → src/cadence-api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ ARG TARGETPLATFORM BUILDPLATFORM TARGETOS TARGETARCH
WORKDIR /cadence
COPY ./* ./
RUN go mod download
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o /cadence-server
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o /cadence-api

ARG ARCH=
FROM ${ARCH}golang:1.21-alpine
LABEL maintainer="Ken Ellorando (kenellorando.com)"
LABEL source="github.com/kenellorando/cadence"
COPY --from=builder /cadence/public /cadence/server/public
COPY --from=builder /cadence-server /cadence/cadence-server
COPY --from=builder /cadence/public /cadence/api/public
COPY --from=builder /cadence-api /cadence/cadence-api

RUN adduser --disabled-password --gecos "" cadence
RUN chown cadence /cadence/ /cadence/* /cadence/cadence-server
RUN chown cadence /cadence/ /cadence/* /cadence/cadence-api
RUN chmod u+wrx /cadence/ /cadence/*

EXPOSE 8080
USER cadence
CMD [ "/cadence/cadence-server" ]
CMD [ "/cadence/cadence-api" ]
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN ln -s /usr/bin/dpkg-split /usr/sbin/dpkg-split && \
RUN apt clean all
RUN apt update
RUN apt install liquidsoap=1.4.3-3 -y
RUN apt autoremove
RUN apt autoremove --purge
EXPOSE 1234
USER liquidsoap
CMD [ "liquidsoap", "-t", "/etc/liquidsoap/cadence.liq" ]
Loading