-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
19 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
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,21 +1,38 @@ | ||
# pull official base image | ||
FROM python:3.10-alpine as builder | ||
# Dockerfile | ||
|
||
# ubuntu 사용자 및 그룹 추가 | ||
RUN addgroup -S ubuntu || true && adduser -S ubuntu -G ubuntu || true | ||
# 기존 명령들 위에 아래 명령을 추가합니다 | ||
RUN mkdir -p /UPCY_BE/logs | ||
RUN touch /UPCY_BE/logs/debug.log | ||
RUN chown -R ubuntu:ubuntu /UPCY_BE/logs | ||
RUN addgroup -S ubuntu && adduser -S ubuntu -G ubuntu | ||
|
||
# 로그 디렉토리 및 파일 생성 | ||
RUN mkdir -p /var/log/uwsgi/UPCY | ||
RUN chown -R ubuntu:ubuntu /var/log/uwsgi | ||
|
||
# 의존성 패키지 설치 및 삭제 | ||
|
||
RUN apk update && apk add python3 python3-dev mariadb-dev build-base coreutils linux-headers pcre-dev && pip3 install mysqlclient && apk del python3-dev mariadb-dev build-base | ||
RUN apk add --no-cache gcc musl-dev python3-dev mariadb-connector-c-dev | ||
|
||
RUN pip install ruamel.yaml.clib | ||
RUN mkdir /srv/UPCY_BE | ||
WORKDIR /srv/UPCY_BE | ||
COPY requirements.txt /srv/UPCY_BE/requirements.txt | ||
RUN python3 -m pip install --upgrade pip | ||
RUN pip install -r requirements.txt | ||
COPY . /srv/UPCY_BE/ | ||
|
||
# 애플리케이션 디렉토리로 작업 디렉토리 설정 | ||
WORKDIR /home/ubuntu/UPCY_BE | ||
|
||
# 가상 환경 생성 | ||
RUN python3 -m venv /home/ubuntu/myvenv | ||
|
||
# requirements.txt 파일을 복사한 후 패키지 설치 | ||
COPY requirements.txt /home/ubuntu/UPCY_BE/requirements.txt | ||
RUN /home/ubuntu/myvenv/bin/pip install --upgrade pip | ||
RUN /home/ubuntu/myvenv/bin/pip install -r requirements.txt | ||
|
||
# 애플리케이션 소스 복사 | ||
COPY . /home/ubuntu/UPCY_BE/ | ||
|
||
# 소유자 변경 | ||
RUN chown -R ubuntu:ubuntu /home/ubuntu/UPCY_BE | ||
|
||
USER ubuntu | ||
|
||
# 기본 명령어 설정 | ||
ENTRYPOINT ["/home/ubuntu/myvenv/bin/uwsgi", "--ini", "/home/ubuntu/UPCY_BE/.config/uwsgi/UPCY.ini"] |
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