a11yist/Dockerfile

99 lines
4.6 KiB
Docker

ARG RUBY_VERSION=3.2.5
FROM ruby:${RUBY_VERSION}
LABEL maintainer='david@hohl.cloud'
ARG NAME=app
ARG UID=1000
ARG GID=1000
ARG APP_PORT=3000
ARG INSTALL_DIR=/${NAME}
ARG NAME
ARG UID
ARG GID
ARG APP_PORT
ARG INSTALL_DIR
WORKDIR ${INSTALL_DIR}
ENV GEM_HOME=${INSTALL_DIR}/.bundle
ENV \
LANG=C.UTF-8 \
INSTALL_DIR=${INSTALL_DIR} \
RAILS_ENV=development \
TZ=Europe/Zurich \
PATH=${INSTALL_DIR}/bin:$GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH \
EDITOR=vim
RUN \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
addgroup --gid ${GID} ${NAME} && \
adduser \
--gecos GECOS \
--home /home/${NAME} \
--uid ${UID} \
--gid ${GID} \
--disabled-password \
--disabled-login \
--shell /bin/bash \
${NAME} && \
apt-get update && \
apt-get install -yqq --no-install-recommends \
gnupg2 \
curl && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update -yqq && \
apt-get install -yqq --no-install-recommends \
sqlite3 nodejs npm sassc yarn libvips fish ranger pandoc libjemalloc2 && \
apt-get clean && \
npm i -g vscode-langservers-extracted \
dockerfile-language-server-nodejs \
@microsoft/compose-language-service \
yaml-language-server@next \
bash-language-server \
typescript-language-server typescript && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log && \
gem update --system && \
bundle config set app_config ${GEM_HOME} && \
mkdir -p /home/${NAME}/.ssh && \
echo "|1|MY0IaoqveusfUdYlTFzGnB95mhI=|XyUGTfOoKc7vGP5WTlFwT1RU+5E= ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOLCA3O6oc0+BplWjB5Vi4jPNnGAYo24oANcylCc9i8W\
|1|pYFp+C6PAszoVmLOZliWYonpzC0=|QbeRMKsmnFBrqoH38UKkjZdISJI= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2PqML1VEXRdMc/WTjjN00FWw2vDl11q+0glBLQwQiBV5r3kL1kXWP7rUtuBPfivz4/ZpzkpHhWbKbnrLazpvSRHqwgMm6S1mQoH4Gb3wLwCqvoE/M8BSJsXvlJem63y/W4mtQEboZ+YyBzW1Yss41jBW9tfQxXCVlikPWm/O20hr3uealymIH5GaONE65mY9JfPr7z6AAJZ8bAfO69HWp+Q1dRD2sin3/cY+a25eQ6PWmR7g/Xw3/6pNikOj2LMErZdyCxVhCKmHeDDrWzn8qJgfPRqz9Pneb3qIBOw6kJnTfQGc+7KLZmmqRUChoLuw5jTYthngZVXJ/A0XJG30mqtrQj9uD7vqmTFXZl8wNuv52ELOwPrvJIpEFvjjNGbg8iRkjElHKub8eGvQhy/sH96Xv6WqxfGiXvyUTWrBOdhhL102fA+nXcsx90Ln0/Rjg5v5meFCT1a+3SLgQeQ44c9xasDwGFrwlR1x4uP8249SldIhKFO+1oXnskTN8Prs=\
|1|FisNvukDUhT0l2SVq4qFF1WFoBQ=|rBWKChHJabb1lM0Og5zcH3lxrOQ= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPknmThDfyVupOSMcGdjP14VEX6e5rXrI3ny+FnLjaCNyGYt7hKyRTfvl32UVXFZqvp+gp6BVdqaKI6ey5Mygfs=" >> /home/${NAME}/.ssh/known_hosts
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
RUN curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \
| gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo
# RUN curl -fsSL https://github.com/Feel-ix-343/markdown-oxide/releases/download/v0.24.3/markdown-oxide-v0.24.3-x86_64-unknown-linux-gnu | install -m 755 /dev/stdin /usr/local/bin/markdown-oxide
RUN curl -fsSL https://github.com/artempyanykh/marksman/releases/download/2024-11-20/marksman-linux-x64 | install -m 755 /dev/stdin /usr/local/bin/marksman
ARG HELIX_VERSION=24.07
RUN curl -L https://github.com/helix-editor/helix/releases/download/${HELIX_VERSION}/helix-${HELIX_VERSION}-x86_64-linux.tar.xz -o /tmp/helix.tar.xz && \
cd /opt/ && \
tar -xf /tmp/helix.tar.xz && \
ln -s /opt/helix-${HELIX_VERSION}-x86_64-linux/hx /usr/local/bin
RUN mkdir -p /home/app/.config/{helix, fish}
RUN mkdir -p /home/app/.config/helix/runtime/queries/slim && \
curl https://raw.githubusercontent.com/kolen/tree-sitter-slim/refs/heads/master/queries/highlights.scm -o /home/app/.config/helix/runtime/queries/slim/highlights.scm && \
curl https://raw.githubusercontent.com/kolen/tree-sitter-slim/refs/heads/master/queries/injections.scm -o /home/app/.config/helix/runtime/queries/slim/injections.scm && \
chown 1000:1000 -R /home/app
RUN mkdir -p /opt/helix-${HELIX_VERSION}-x86_64-linux/runtime/queries/slim && \
curl https://raw.githubusercontent.com/kolen/tree-sitter-slim/refs/heads/master/queries/highlights.scm -o /opt/helix-${HELIX_VERSION}-x86_64-linux/runtime/queries/slim/highlights.scm && \
curl https://raw.githubusercontent.com/kolen/tree-sitter-slim/refs/heads/master/queries/injections.scm -o /opt/helix-${HELIX_VERSION}-x86_64-linux/runtime/queries/slim/injections.scm
COPY bin/dev_entrypoint /usr/local/bin/dev_entrypoint
USER ${NAME}
ENTRYPOINT ["/usr/local/bin/dev_entrypoint"]
CMD ["/bin/sh", "-c", "dev"]