2022-03-09 00:00:03 +01:00
|
|
|
#
|
|
|
|
# Golang dependencies build step
|
|
|
|
#
|
2023-02-02 20:19:41 +01:00
|
|
|
FROM golang:1.19-bullseye 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
|
|
|
|
2022-12-15 02:00:09 +01:00
|
|
|
RUN go install github.com/aptible/supercronic@v0.2.1
|
2022-10-31 12:43:19 +01:00
|
|
|
|
2023-01-11 19:43:39 +01:00
|
|
|
RUN go install github.com/centrifugal/centrifugo/v4@v4.1.2
|
2022-12-02 16:27:16 +01:00
|
|
|
|
2023-02-22 13:19:00 +01:00
|
|
|
#
|
|
|
|
# Rust dependencies build step
|
|
|
|
#
|
|
|
|
FROM rust:1-bullseye AS rust-dependencies
|
|
|
|
|
|
|
|
RUN mkdir -p /tmp/meilisearch
|
|
|
|
|
|
|
|
WORKDIR /tmp/meilisearch
|
|
|
|
|
2023-04-11 05:23:41 +02:00
|
|
|
RUN curl -fsSL https://github.com/meilisearch/meilisearch/archive/refs/tags/v1.1.0.tar.gz -o meilisearch.tar.gz \
|
2023-02-22 13:19:00 +01:00
|
|
|
&& tar -xvzf meilisearch.tar.gz --strip-components=1 \
|
|
|
|
&& cargo build --release \
|
|
|
|
&& chmod a+x ./target/release/meilisearch \
|
|
|
|
&& mv ./target/release/meilisearch /usr/local/bin/meilisearch
|
|
|
|
|
2023-01-13 07:46:27 +01:00
|
|
|
#
|
|
|
|
# MariaDB dependencies build step
|
|
|
|
#
|
|
|
|
FROM mariadb:10.9-jammy AS mariadb
|
|
|
|
|
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
|
|
|
#
|
2023-01-25 08:30:49 +01:00
|
|
|
FROM ubuntu:jammy AS pre-final
|
2020-01-23 01:18:27 +01:00
|
|
|
|
|
|
|
ENV TZ="UTC"
|
|
|
|
|
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
|
2022-12-02 16:27:16 +01:00
|
|
|
COPY --from=go-dependencies /go/bin/centrifugo /usr/local/bin/centrifugo
|
2020-01-23 01:18:27 +01:00
|
|
|
|
2023-02-22 13:19:00 +01:00
|
|
|
# Add Meilisearch
|
|
|
|
COPY --from=rust-dependencies /usr/local/bin/meilisearch /usr/local/bin/meilisearch
|
|
|
|
|
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
|
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
# Run base build process
|
|
|
|
COPY ./util/docker/common /bd_build/
|
2023-01-25 08:30:49 +01:00
|
|
|
RUN bash /bd_build/prepare.sh \
|
|
|
|
&& bash /bd_build/add_user.sh \
|
|
|
|
&& bash /bd_build/cleanup.sh \
|
2022-05-26 03:49:09 +02:00
|
|
|
&& rm -rf /bd_build
|
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/
|
|
|
|
RUN bash /bd_build/supervisor/setup.sh \
|
|
|
|
&& rm -rf /bd_build/supervisor
|
|
|
|
|
2022-03-09 00:00:03 +01:00
|
|
|
COPY ./util/docker/stations /bd_build/stations/
|
|
|
|
RUN bash /bd_build/stations/setup.sh \
|
|
|
|
&& rm -rf /bd_build/stations
|
|
|
|
|
|
|
|
COPY ./util/docker/web /bd_build/web/
|
|
|
|
RUN bash /bd_build/web/setup.sh \
|
|
|
|
&& rm -rf /bd_build/web
|
|
|
|
|
|
|
|
COPY ./util/docker/mariadb /bd_build/mariadb/
|
|
|
|
RUN bash /bd_build/mariadb/setup.sh \
|
|
|
|
&& rm -rf /bd_build/mariadb
|
|
|
|
|
2022-12-06 15:45:43 +01:00
|
|
|
COPY ./util/docker/redis /bd_build/redis/
|
|
|
|
RUN bash /bd_build/redis/setup.sh \
|
|
|
|
&& rm -rf /bd_build/redis
|
|
|
|
|
2023-01-25 08:30:49 +01:00
|
|
|
RUN rm -rf /bd_build
|
|
|
|
|
2023-02-22 13:19:00 +01:00
|
|
|
VOLUME ["/var/azuracast/stations", "/var/azuracast/uploads", "/var/azuracast/backups", "/var/azuracast/sftpgo/persist", "/var/azuracast/servers/shoutcast2", "/var/azuracast/meilisearch/persist"]
|
2023-01-25 08:30:49 +01:00
|
|
|
|
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-01-25 08:30:49 +01:00
|
|
|
FROM ubuntu:jammy AS final
|
|
|
|
|
|
|
|
COPY --from=pre-final / /
|
|
|
|
|
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 ./composer.json ./composer.lock ./
|
2020-01-21 05:24:45 +01:00
|
|
|
RUN composer install \
|
2020-01-22 11:47:37 +01:00
|
|
|
--no-dev \
|
2020-01-21 05:24:45 +01:00
|
|
|
--no-ansi \
|
|
|
|
--no-autoloader \
|
2020-09-01 00:48:10 +02:00
|
|
|
--no-interaction
|
2020-01-21 05:24:45 +01:00
|
|
|
|
2023-02-05 01:36:29 +01:00
|
|
|
COPY --chown=azuracast:azuracast . .
|
2020-01-21 05:24:45 +01:00
|
|
|
|
|
|
|
RUN composer dump-autoload --optimize --classmap-authoritative \
|
|
|
|
&& touch /var/azuracast/.docker
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
2020-06-15 09:00:57 +02:00
|
|
|
EXPOSE 80 2022
|
2022-03-09 00:00:03 +01:00
|
|
|
EXPOSE 8000-8999
|
2020-01-21 05:24:45 +01:00
|
|
|
|
|
|
|
# Sensible default environment variables.
|
2023-01-25 08:30:49 +01:00
|
|
|
ENV TZ="UTC" \
|
|
|
|
LANG="en_US.UTF-8" \
|
|
|
|
PATH="${PATH}:/var/azuracast/servers/shoutcast2" \
|
2022-03-09 00:00:03 +01:00
|
|
|
DOCKER_IS_STANDALONE="true" \
|
2021-03-27 16:15:17 +01:00
|
|
|
APPLICATION_ENV="production" \
|
2022-03-09 00:00:03 +01:00
|
|
|
MYSQL_HOST="localhost" \
|
2020-01-21 05:24:45 +01:00
|
|
|
MYSQL_PORT=3306 \
|
|
|
|
MYSQL_USER="azuracast" \
|
|
|
|
MYSQL_PASSWORD="azur4c457" \
|
|
|
|
MYSQL_DATABASE="azuracast" \
|
2021-06-28 17:03:21 +02:00
|
|
|
ENABLE_REDIS="true" \
|
2022-03-09 00:00:03 +01:00
|
|
|
REDIS_HOST="localhost" \
|
2021-06-28 17:03:21 +02:00
|
|
|
REDIS_PORT=6379 \
|
|
|
|
REDIS_DB=1 \
|
2021-07-24 02:15:58 +02:00
|
|
|
NGINX_RADIO_PORTS="default" \
|
|
|
|
NGINX_WEBDJ_PORTS="default" \
|
2020-01-21 05:24:45 +01:00
|
|
|
PREFER_RELEASE_BUILDS="false" \
|
|
|
|
COMPOSER_PLUGIN_MODE="false" \
|
2021-04-18 03:50:54 +02:00
|
|
|
ADDITIONAL_MEDIA_SYNC_WORKER_COUNT=0 \
|
|
|
|
PROFILING_EXTENSION_ENABLED=0 \
|
2021-04-18 07:03:22 +02:00
|
|
|
PROFILING_EXTENSION_ALWAYS_ON=0 \
|
|
|
|
PROFILING_EXTENSION_HTTP_KEY=dev \
|
2023-01-05 19:54:03 +01:00
|
|
|
PROFILING_EXTENSION_HTTP_IP_WHITELIST=* \
|
2023-02-22 13:19:00 +01:00
|
|
|
ENABLE_WEB_UPDATER="true" \
|
2023-02-22 18:13:34 +01:00
|
|
|
ENABLE_MEILISEARCH="true" \
|
|
|
|
MEILISEARCH_MASTER_KEY="zejNISMlGe_6IUGBsdjfG6c6Qi8g2RngTxOmWsTbwvw"
|
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"]
|