83 lines
2.4 KiB
Docker
83 lines
2.4 KiB
Docker
# Containerfile
|
|
|
|
# 기반 이미지를 NVIDIA CUDA 이미지로 변경
|
|
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04
|
|
|
|
#MAINTAINER "birdhead"
|
|
|
|
# 로케일 및 타임존 환경 변수 설정
|
|
ENV LANG en_US.UTF-8
|
|
ENV TZ=Asia/Seoul
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# 패키지 설치
|
|
RUN echo "deb http://kr.archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" > /etc/apt/sources.list && \
|
|
echo "deb http://kr.archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb http://kr.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
cron \
|
|
rsyslog \
|
|
openssh-server \
|
|
supervisor \
|
|
build-essential \
|
|
vim \
|
|
curl \
|
|
wget \
|
|
git \
|
|
ca-certificates \
|
|
gnupg \
|
|
sudo \
|
|
pkg-config \
|
|
cmake \
|
|
g++ \
|
|
gdb \
|
|
libboost-all-dev \
|
|
libdcmtk-dev \
|
|
libsndfile1-dev \
|
|
libpq-dev \
|
|
libnsl-dev \
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
jq \
|
|
# net-tools \
|
|
ffmpeg \
|
|
libopenblas-dev && \
|
|
ssh-keygen -A && \
|
|
mkdir -p /run/sshd && \
|
|
chown root:root /run/sshd && \
|
|
chmod 755 /run/sshd && \
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
|
apt-get install -y nodejs && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
# 필요한 커스텀 파일들을 이미지에 미리 복사
|
|
COPY --chown=root:root ./system/etc/. /etc/
|
|
COPY --chown=root:root ./system/usr_local/. /usr/local/
|
|
|
|
# Set Timezone
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
# npm을 사용하여 pm2 전역 설치
|
|
RUN npm install pm2 -g && npm cache clean --force
|
|
|
|
# ssdoctors 사용자가 비밀번호 없이 sudo를 사용하도록 설정
|
|
RUN echo "ssdoctors ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ssdoctors
|
|
|
|
# supervisord.conf 파일을 컨테이너 안으로 복사
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
# 컨테이너 시작 시 실행할 명령
|
|
#CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
|
|
|
|
|
|
# ✅ entrypoint.sh 스크립트 추가
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|