2022-03-09 00:00:03 +01:00
|
|
|
#
|
|
|
|
# Golang dependencies build step
|
|
|
|
#
|
2024-02-13 13:20:52 +01:00
|
|
|
FROM golang:1.21-bookworm AS go-dependencies
|
2021-12-10 10:56:05 +01:00
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y --no-install-recommends openssl git
|
|
|
|
|
2022-12-15 02:00:09 +01:00
|
|
|
RUN go install github.com/jwilder/dockerize@v0.6.1
|
2021-12-10 10:56:05 +01:00
|
|
|
|
2023-11-28 08:12:07 +01:00
|
|
|
RUN go install github.com/aptible/supercronic@v0.2.28
|
2022-10-31 12:43:19 +01:00
|
|
|
|
2024-01-23 00:03:36 +01:00
|
|
|
RUN go install github.com/centrifugal/centrifugo/v5@v5.2.2
|
2023-12-13 16:57:51 +01:00
|
|
|
|
2023-01-13 07:46:27 +01:00
|
|
|
#
|
|
|
|
# MariaDB dependencies build step
|
|
|
|
#
|
2023-11-28 08:17:26 +01:00
|
|
|
FROM mariadb:11.2-jammy AS mariadb
|
2023-01-13 07:46:27 +01:00
|
|
|
|
2023-12-12 17:43:14 +01:00
|
|
|
#
|
|
|
|
# Built-in docs build step
|
|
|
|
#
|
|
|
|
FROM ghcr.io/azuracast/azuracast.com:builtin AS docs
|
|
|
|
|
2023-12-13 13:24:42 +01:00
|
|
|
#
|
|
|
|
# Icecast-KH with AzuraCast customizations build step
|
|
|
|
#
|
2024-02-13 13:20:52 +01:00
|
|
|
FROM ghcr.io/azuracast/icecast-kh-ac:2024-02-13 AS icecast
|
2023-12-13 13:24:42 +01:00
|
|
|
|
2023-12-23 05:00:40 +01:00
|
|
|
#
|
|
|
|
# Roadrunner build step
|
|
|
|
#
|
|
|
|
FROM ghcr.io/roadrunner-server/roadrunner:2023.3.8 AS roadrunner
|
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
#
|
2021-12-10 10:56:05 +01:00
|
|
|
# Final build image
|
2022-03-09 00:00:03 +01:00
|
|
|
#
|
2024-02-13 13:20:52 +01:00
|
|
|
FROM php:8.3-fpm-bookworm AS pre-final
|
2020-01-23 01:18:27 +01:00
|
|
|
|
2024-02-13 13:20:52 +01:00
|
|
|
ENV TZ="UTC" \
|
|
|
|
LANGUAGE="en_US.UTF-8" \
|
|
|
|
LC_ALL="en_US.UTF-8" \
|
|
|
|
LANG="en_US.UTF-8" \
|
|
|
|
LC_TYPE="en_US.UTF-8"
|
|
|
|
|
|
|
|
# Add PHP extension installer tool
|
|
|
|
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
2020-01-23 01:18:27 +01:00
|
|
|
|
2023-01-30 10:34:02 +01:00
|
|
|
# Add Go dependencies
|
2022-10-31 12:43:19 +01:00
|
|
|
COPY --from=go-dependencies /go/bin/dockerize /usr/local/bin
|
|
|
|
COPY --from=go-dependencies /go/bin/supercronic /usr/local/bin/supercronic
|
2023-12-13 16:57:51 +01:00
|
|
|
COPY --from=go-dependencies /go/bin/centrifugo /usr/local/bin/centrifugo
|
2020-01-23 01:18:27 +01:00
|
|
|
|
2023-01-30 10:34:02 +01:00
|
|
|
# Add MariaDB dependencies
|
|
|
|
COPY --from=mariadb /usr/local/bin/healthcheck.sh /usr/local/bin/db_healthcheck.sh
|
|
|
|
COPY --from=mariadb /usr/local/bin/docker-entrypoint.sh /usr/local/bin/db_entrypoint.sh
|
|
|
|
|
2023-12-13 13:24:42 +01:00
|
|
|
# Add Icecast
|
|
|
|
COPY --from=icecast /usr/local/bin/icecast /usr/local/bin/icecast
|
|
|
|
COPY --from=icecast /usr/local/share/icecast /usr/local/share/icecast
|
|
|
|
|
2023-12-23 05:00:40 +01:00
|
|
|
# Add Roadrunner
|
|
|
|
COPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr
|
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
# Run base build process
|
|
|
|
COPY ./util/docker/common /bd_build/
|
2023-04-14 23:31:05 +02:00
|
|
|
|
2023-01-25 08:30:49 +01:00
|
|
|
RUN bash /bd_build/prepare.sh \
|
2023-12-14 22:43:50 +01:00
|
|
|
&& bash /bd_build/add_user.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh
|
2022-03-09 00:00:03 +01:00
|
|
|
|
2023-12-12 17:43:14 +01:00
|
|
|
# Add built-in docs
|
|
|
|
COPY --from=docs --chown=azuracast:azuracast /dist /var/azuracast/docs
|
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
# Build each set of dependencies in their own step for cacheability.
|
2022-05-26 03:49:09 +02:00
|
|
|
COPY ./util/docker/supervisor /bd_build/supervisor/
|
2023-12-12 15:03:54 +01:00
|
|
|
RUN bash /bd_build/supervisor/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build/supervisor
|
2022-05-26 03:49:09 +02:00
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
COPY ./util/docker/stations /bd_build/stations/
|
2023-12-12 15:03:54 +01:00
|
|
|
RUN bash /bd_build/stations/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build/stations
|
2022-03-09 00:00:03 +01:00
|
|
|
|
|
|
|
COPY ./util/docker/web /bd_build/web/
|
2023-12-12 15:03:54 +01:00
|
|
|
RUN bash /bd_build/web/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build/web
|
2022-03-09 00:00:03 +01:00
|
|
|
|
|
|
|
COPY ./util/docker/mariadb /bd_build/mariadb/
|
2023-12-12 15:03:54 +01:00
|
|
|
RUN bash /bd_build/mariadb/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build/mariadb
|
2022-03-09 00:00:03 +01:00
|
|
|
|
2022-12-06 15:45:43 +01:00
|
|
|
COPY ./util/docker/redis /bd_build/redis/
|
2023-12-12 15:03:54 +01:00
|
|
|
RUN bash /bd_build/redis/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build/redis
|
2022-12-06 15:45:43 +01:00
|
|
|
|
2023-11-03 14:56:10 +01:00
|
|
|
RUN bash /bd_build/chown_dirs.sh \
|
2023-04-14 23:31:05 +02:00
|
|
|
&& rm -rf /bd_build
|
2023-01-25 08:30:49 +01:00
|
|
|
|
2023-08-05 18:18:38 +02:00
|
|
|
USER azuracast
|
|
|
|
|
2023-12-08 15:50:26 +01:00
|
|
|
RUN touch /var/azuracast/.docker
|
2023-08-05 18:18:38 +02:00
|
|
|
|
|
|
|
USER root
|
|
|
|
|
2023-11-03 14:56:10 +01:00
|
|
|
VOLUME "/var/azuracast/stations"
|
|
|
|
VOLUME "/var/azuracast/backups"
|
2023-11-03 16:41:21 +01:00
|
|
|
VOLUME "/var/lib/mysql"
|
2023-11-03 14:56:10 +01:00
|
|
|
VOLUME "/var/azuracast/storage/uploads"
|
|
|
|
VOLUME "/var/azuracast/storage/shoutcast2"
|
|
|
|
VOLUME "/var/azuracast/storage/stereo_tool"
|
|
|
|
VOLUME "/var/azuracast/storage/geoip"
|
|
|
|
VOLUME "/var/azuracast/storage/sftpgo"
|
|
|
|
VOLUME "/var/azuracast/storage/acme"
|
2023-01-25 08:30:49 +01:00
|
|
|
|
2023-12-24 08:20:30 +01:00
|
|
|
EXPOSE 80 443 2022
|
|
|
|
EXPOSE 8000-8999
|
|
|
|
|
|
|
|
# Sensible default environment variables.
|
|
|
|
ENV LANG="en_US.UTF-8" \
|
|
|
|
PATH="${PATH}:/var/azuracast/storage/shoutcast2" \
|
|
|
|
APPLICATION_ENV="production" \
|
|
|
|
MYSQL_HOST="localhost" \
|
|
|
|
MYSQL_PORT=3306 \
|
|
|
|
MYSQL_USER="azuracast" \
|
|
|
|
MYSQL_PASSWORD="azur4c457" \
|
|
|
|
MYSQL_DATABASE="azuracast" \
|
|
|
|
ENABLE_REDIS="true" \
|
|
|
|
REDIS_HOST="localhost" \
|
|
|
|
REDIS_PORT=6379 \
|
|
|
|
REDIS_DB=1 \
|
|
|
|
NGINX_RADIO_PORTS="default" \
|
|
|
|
NGINX_WEBDJ_PORTS="default" \
|
|
|
|
COMPOSER_PLUGIN_MODE="false" \
|
|
|
|
ADDITIONAL_MEDIA_SYNC_WORKER_COUNT=0 \
|
|
|
|
PROFILING_EXTENSION_ENABLED=0 \
|
|
|
|
PROFILING_EXTENSION_ALWAYS_ON=0 \
|
|
|
|
PROFILING_EXTENSION_HTTP_KEY=dev \
|
|
|
|
PROFILING_EXTENSION_HTTP_IP_WHITELIST=* \
|
|
|
|
ENABLE_WEB_UPDATER="true"
|
|
|
|
|
2023-08-05 18:18:38 +02:00
|
|
|
#
|
|
|
|
# Development Build
|
|
|
|
#
|
|
|
|
FROM pre-final AS development
|
|
|
|
|
|
|
|
# Dev build step
|
|
|
|
COPY ./util/docker/common /bd_build/
|
|
|
|
COPY ./util/docker/dev /bd_build/dev
|
|
|
|
|
|
|
|
RUN bash /bd_build/dev/setup.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
|
|
|
&& rm -rf /bd_build
|
|
|
|
|
|
|
|
USER azuracast
|
|
|
|
|
|
|
|
WORKDIR /var/azuracast/www
|
|
|
|
|
|
|
|
COPY --chown=azuracast:azuracast . .
|
|
|
|
|
2023-12-13 19:52:58 +01:00
|
|
|
RUN composer install --no-ansi --no-interaction \
|
|
|
|
&& composer clear-cache
|
2023-08-05 18:18:38 +02:00
|
|
|
|
|
|
|
WORKDIR /var/azuracast/www/frontend
|
|
|
|
|
2023-12-13 19:52:58 +01:00
|
|
|
RUN npm ci --include=dev \
|
|
|
|
&& npm cache clean --force
|
2023-08-05 18:18:38 +02:00
|
|
|
|
|
|
|
WORKDIR /var/azuracast/www
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
# Sensible default environment variables.
|
2023-12-24 08:20:30 +01:00
|
|
|
ENV APPLICATION_ENV="development" \
|
2023-08-05 18:18:38 +02:00
|
|
|
PROFILING_EXTENSION_ENABLED=1 \
|
|
|
|
ENABLE_WEB_UPDATER="false"
|
|
|
|
|
|
|
|
# Entrypoint and default command
|
|
|
|
ENTRYPOINT ["tini", "--", "/usr/local/bin/my_init"]
|
|
|
|
CMD ["--no-main-command"]
|
|
|
|
|
2020-01-21 05:24:45 +01:00
|
|
|
#
|
2023-01-25 08:30:49 +01:00
|
|
|
# Final build (Just environment vars and squishing the FS)
|
2020-01-21 05:24:45 +01:00
|
|
|
#
|
2023-12-24 08:20:30 +01:00
|
|
|
FROM pre-final AS final
|
2023-01-25 08:30:49 +01:00
|
|
|
|
2020-01-21 05:24:45 +01:00
|
|
|
USER azuracast
|
|
|
|
|
|
|
|
WORKDIR /var/azuracast/www
|
|
|
|
|
2023-02-05 01:36:29 +01:00
|
|
|
COPY --chown=azuracast:azuracast . .
|
2020-01-21 05:24:45 +01:00
|
|
|
|
2023-12-13 19:52:58 +01:00
|
|
|
RUN composer install --no-dev --no-ansi --no-autoloader --no-interaction \
|
|
|
|
&& composer dump-autoload --optimize --classmap-authoritative \
|
|
|
|
&& composer clear-cache
|
2023-08-05 18:18:38 +02:00
|
|
|
|
2023-12-07 05:32:41 +01:00
|
|
|
USER root
|
2023-12-06 17:26:31 +01:00
|
|
|
|
2020-01-21 05:24:45 +01:00
|
|
|
# Entrypoint and default command
|
2022-05-26 03:49:09 +02:00
|
|
|
ENTRYPOINT ["tini", "--", "/usr/local/bin/my_init"]
|
2022-03-09 00:00:03 +01:00
|
|
|
CMD ["--no-main-command"]
|