-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile and docker-compose.yaml for improved installation…
… and environment variable consistency
- Loading branch information
1 parent
172b9d8
commit e84e8bc
Showing
2 changed files
with
26 additions
and
39 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 |
---|---|---|
@@ -1,46 +1,35 @@ | ||
# syntax=docker/dockerfile:1.4 | ||
FROM --platform=$BUILDPLATFORM ubuntu:latest | ||
|
||
ARG TARGETARCH | ||
FROM ubuntu:latest | ||
|
||
ARG VERSION=1.0.5 | ||
ARG RELEASES_URL="https://github.com/ErdemOzgen/blackdagger/releases" | ||
ARG TARGET_FILE="blackdagger_${VERSION}_linux_${TARGETARCH}.tar.gz" | ||
|
||
ARG USER="blackdagger" | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8090 | ||
|
||
# Avoid tzdata prompts | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install necessary packages and setup user before switching | ||
RUN echo "Etc/UTC" > /etc/timezone && \ | ||
# Install necessary packages | ||
RUN apt-get update -y && \ | ||
apt-get install -y wget curl bash sudo tzdata && \ | ||
echo "Etc/UTC" > /etc/timezone && \ | ||
ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ | ||
apt-get update -y && \ | ||
apt-get install -y sudo tzdata wget curl bash git && \ | ||
dpkg-reconfigure --frontend noninteractive tzdata && \ | ||
groupadd -g ${USER_GID} ${USER} && \ | ||
useradd -m -d /home/${USER} -u ${USER_UID} -g ${USER_GID} -s /bin/bash ${USER} && \ | ||
echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER} && \ | ||
chmod 0440 /etc/sudoers.d/${USER} | ||
|
||
# Switch back to root if needed for installing software or performing tasks that require root privileges | ||
USER root | ||
|
||
WORKDIR /home/${USER} | ||
dpkg-reconfigure --frontend noninteractive tzdata | ||
|
||
# Download and install the application | ||
# RUN wget ${RELEASES_URL}/download/v${VERSION}/${TARGET_FILE} && \ | ||
# tar -xf ${TARGET_FILE} && rm *.tar.gz && \ | ||
# mv blackdagger /usr/local/bin/ && \ | ||
# mkdir .blackdagger | ||
|
||
RUN curl -L https://raw.githubusercontent.com/ErdemOzgen/blackdagger/main/scripts/blackdagger-installer.sh | sudo bash | ||
# Download, make executable, and run the blackdagger installer script | ||
RUN curl -L https://raw.githubusercontent.com/ErdemOzgen/blackdagger/main/scripts/blackdagger-installer.sh -o blackdagger-installer.sh && \ | ||
chmod +x blackdagger-installer.sh && \ | ||
sudo bash blackdagger-installer.sh && \ | ||
rm blackdagger-installer.sh | ||
|
||
# Environment variables for the application | ||
ENV BLACKDAGGER_HOST=0.0.0.0 | ||
ENV BLACKDAGGER_PORT=8080 | ||
COPY ./startservices.sh /home/${USER}/startservices.sh | ||
#CMD ["blackdagger", "server"] | ||
|
||
# Copy the start script and set permissions | ||
COPY ./startservices.sh /usr/local/bin/startservices.sh | ||
RUN chmod +x /usr/local/bin/startservices.sh | ||
|
||
CMD ["sh", "/usr/local/bin/startservices.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