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

Self contained Teedy Dockerfile #745

Merged
merged 15 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
50 changes: 48 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
FROM sismics/ubuntu-jetty:11.0.14
FROM ubuntu:22.04

# Run Debian in non interactive mode
ENV DEBIAN_FRONTEND noninteractive

# Install Sismics repository
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates software-properties-common curl gnupg tzdata
RUN curl -fsSL https://www.sismics.com/pgp | apt-key add -
jendib marked this conversation as resolved.
Show resolved Hide resolved
# RUN add-apt-repository "deb [arch=amd64] https://nexus.sismics.com/repository/apt-bionic/ bionic main"

# Configure settings
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
jendib marked this conversation as resolved.
Show resolved Hide resolved
RUN dpkg-reconfigure -f noninteractive tzdata
COPY etc /etc
RUN echo "for f in \`ls /etc/bashrc.d/*\`; do . \$f; done;" >> ~/.bashrc
RUN apt-get -y -q install vim less procps unzip wget && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && \
apt-get -y -q install openjdk-11-jdk && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64/
ENV JAVA_OPTS -Duser.timezone=Europe/Paris -Dfile.encoding=UTF-8 -Xmx1024m

ENV JETTY_VERSION 11.0.14
jendib marked this conversation as resolved.
Show resolved Hide resolved
RUN wget -nv -O /tmp/jetty.tar.gz \
"https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/${JETTY_VERSION}/jetty-home-${JETTY_VERSION}.tar.gz" \
&& tar xzf /tmp/jetty.tar.gz -C /opt \
&& mv /opt/jetty* /opt/jetty \
&& useradd jetty -U -s /bin/false \
&& chown -R jetty:jetty /opt/jetty \
&& mkdir /opt/jetty/webapps
WORKDIR /opt/jetty
RUN chmod +x bin/jetty.sh

# Init configuration
COPY opt /opt
EXPOSE 8080
ENV JETTY_HOME /opt/jetty
ENV JAVA_OPTIONS -Xmx512m

LABEL maintainer="[email protected]"

RUN apt-get update && \
jendib marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -44,5 +87,8 @@ ADD docs-web/target/docs-web-*.war /app/webapps/docs.war
ENV JAVA_OPTIONS -Xmx1g

WORKDIR /app
CMD ["java", "-jar", "/opt/jetty/start.jar"]
# Set the default command to run when starting the container
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

CMD ["/entrypoint.sh"]
7 changes: 7 additions & 0 deletions entrypoint.sh
jendib marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Your first command
/bin/jetty.sh run &

# Your second command
java -jar /opt/jetty/start.jar
5 changes: 5 additions & 0 deletions etc/bashrc.d/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export SHELL=/bin/bash
export LS_OPTIONS='--color=auto'
eval "`dircolors /etc/dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls -l'
Loading