79 lines
3.1 KiB
Plaintext
79 lines
3.1 KiB
Plaintext
# image_files/Containerfile
|
|
FROM localhost/base-server:latest
|
|
|
|
MAINTAINER "birdhead"
|
|
|
|
# 로케일 및 타임존 환경 변수 설정
|
|
ENV LANG en_US.UTF-8
|
|
ENV TZ=Asia/Seoul
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# ✅ 1. 필요한 커스텀 파일들을 이미지에 미리 복사합니다.
|
|
# 이 경로는 docker-compose.yml이 있는 위치를 기준으로 합니다.
|
|
COPY --chown=root:root ./system/etc/. /etc/
|
|
COPY --chown=root:root ./system/usr_local/. /usr/local/
|
|
|
|
# cron 패키지만 설치하도록 RUN 구문 대폭 수정
|
|
RUN \
|
|
rm -f /etc/apt/sources.list.d/ubuntu.sources && \
|
|
echo "deb http://kr.archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse" > /etc/apt/sources.list && \
|
|
echo "deb http://kr.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb http://kr.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb http://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
echo "deb http://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse" >> /etc/apt/sources.list && \
|
|
apt-get update && \
|
|
# ✅ blas 관련 패키지를 검색하여 정확한 이름을 찾습니다.
|
|
apt-cache search blas && \
|
|
# ✅ 검색된 이름을 바탕으로 패키지를 설치합니다.
|
|
# Ubuntu 24.04 (noble)에서는 libopenblas-dev가 기본일 수 있습니다.
|
|
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 \
|
|
ffmpeg libopenblas-dev && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# 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
|
|
|
|
|
|
# Supervisor 설정 파일을 기본 위치에 링크하여 supervisorctl이 쉽게 찾도록 함
|
|
RUN ln -s /etc/supervisor/conf.d/supervisord.conf /etc/supervisord.conf
|
|
|
|
|
|
# start.sh 스크립트를 복사하고 실행 권한 부여
|
|
#COPY start.sh /usr/local/bin/start.sh
|
|
#RUN chmod +x /usr/local/bin/start.sh
|
|
|
|
# 컨테이너 시작 시 실행할 명령을 새로운 start.sh로 변경
|
|
#ENTRYPOINT ["/usr/local/bin/start.sh"]
|
|
#CMD []
|
|
|
|
|
|
# ENTRYPOINT는 준비 스크립트를 실행
|
|
#ENTRYPOINT ["/usr/local/bin/start.sh"]
|
|
|
|
# CMD는 supervisord를 실행 (ENTRYPOINT의 마지막 exec "$@"를 통해 실행됨)
|
|
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
|
|
|
|
|
|
|
|
|
|
|