메뉴 건너뛰기

SayClub.org

도커(Docker)

<docker-compose.yml>

 

services:
  squid:
    image: ubuntu/squid
    restart: always
    container_name: squid
    volumes:
      - ./squid.conf:/etc/squid/squid.conf
      - ./domains.txt:/etc/squid/domains.txt
      - ./ips.txt:/etc/squid/ips.txt
      - ./debian.conf:/etc/squid/conf.d/debian.conf
      - ./log:/var/log/squid
    environment:
      - TZ=Asia/Seoul
    ports:
      - 3128:3128
    ulimits:
      nofile:
        soft: 65535
        hard: 65535
      nproc: 65535
 

<docker-compose.yml 파일 생성 후>

mkdir -p ./log #필수

sudo chown -R 13.13 ./log #필수

 

<domains.txt> #허용 도메인

.fss.or.kr
.fsec.or.kr
.fsc.go.kr
.fsb.or.kr
.law.go.kr
.foresys.co.kr
.microsoft.com
.windowsupdate.com
.windows.com
.office.com
.office.net
.microsoftonline.com
.ahnlab.com

.hometax.go.kr
.speedycdn.net #홈텍스 관련

 

<ips.txt> #허용 IP

172.23.38.0/24
172.23.39.0/24
10.2.2.0/24
1.1.1.1
1.0.0.1
8.8.8.8
8.8.4.4
9.9.9.9

 

<squid.conf>

# Access Control Lists (ACLs)
# acl charmbank src 0.0.0.0/0.0.0.0
#acl localnet src 10.0.0.0/8    # RFC1918 possible internal network
#acl localnet src 172.16.0.0/12    # RFC1918 possible internal network
#acl localnet src 192.168.0.0/16    # RFC1918 possible internal network
#acl localnet src fc00::/7       # RFC 4193 local private network range
#acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
acl charmbank src 172.23.38.0/24
acl charmbank src 172.23.39.0/24
#acl idc_cidr src 192.168.50.0/24
#acl idc_cidr src 192.168.20.0/24

 

acl SSL_ports port 443
acl SSL_ports port 20000
#acl SSL_ports port 389
#acl SSL_ports port 8100
acl Safe_ports port 80          # http
acl Safe_ports port 443         # https
#acl Safe_ports port 389         # Koscom TSA 시점확인(PPR)
#acl Safe_ports port 8100        # MMS_MO 웹팩스연동 LG U+
acl Safe_ports port 20000       # 금감원 보고서작성기
acl CONNECT method CONNECT

 

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

 

# 특정 IP 주소 또는 도메인 허용
acl allow_ip dst "/etc/squid/ips.txt"
acl allow_domain dstdomain "/etc/squid/domains.txt"

 

#http_access allow SSL_ports
http_access allow charmbank allow_ip
http_access allow charmbank allow_domain
#http_access allow idc_cidr allow_ip
#http_access allow idc_cidr allow_domain

 

# Deny all other connections
http_access deny all

 

# Port Configuration
http_port 3128

 

# Log Configuration
access_log daemon:/var/log/squid/access.log

 

# Cache Configuration
cache_mem 512 MB
maximum_object_size 128 MB
cache_dir ufs /var/spool/squid 10000 16 256

 

# Refresh Patterns
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern . 0 20% 4320

 

# via version off
via off

 

# Server version off
httpd_suppress_version_string on
reply_header_access Server deny all

 

# Cache version off
reply_header_access X-Cache deny all
reply_header_access X-Cache-Lookup deny all
#cache_effective_user proxy
#cache_effective_group proxy
 

<debian.conf>

#
# Squid configuration settings for Debian
#

# Logs are managed by logrotate on Debian
logfile_rotate 0

# For extra security Debian packages only allow
# localhost to use the proxy on new installs
#
#http_access allow localnet
http_access allow charmbank
 

번호 제목 글쓴이 날짜 조회 수
55 Docker - prune 도커 정리하기 미르다테 2025.11.28 26
54 도커(Docker)로 Tugtainer 설치하기(Watchtower 대체) 미르다테 2025.11.18 36
53 도커(Docker)로 Zoraxy 설치하기 미르다테 2025.07.16 140
52 도커(Docker)로 Syslog-ng 설치하기 미르다테 2025.07.07 160
51 도커(Docker)로 Guacamole 설치하기 file 미르다테 2025.06.12 157
50 도커(Docker)로 Drupal CMS 설치하기 미르다테 2025.05.23 167
49 도커(Docker)로 Arachni UI Web(웹스캐너) 설치하기 미르다테 2025.05.14 195
48 도커(Docker)로 diun(Docker Image Update Notifier) 구축하기 미르다테 2025.04.18 178
47 도커(Docker)로 Minio 설치하기 미르다테 2025.04.17 211
» 도커(Docker)로 Rocky Linux 9.5에 Squid Proxy 설치하기 미르다테 2025.04.15 156
45 도커(Docker)로 Zabbix 서버 구축하기 미르다테 2025.04.15 127
44 vaultwarden 버전 확인하기 미르다테 2025.02.10 127
43 Docker-compose up -d 시 실행 오류 해결 방법 미르다테 2024.12.30 151
42 Squid를 Docker 컨테이너로 실행하는 방법 미르다테 2024.12.30 124
41 도커(Docker)로 컨테이너 Log 확인툴(Dozzle) 설치하기 미르다테 2024.12.30 127
40 도커(Docker)로 It-Tools 설치하기 미르다테 2024.12.30 188
39 도커(Docker) YAML 문법 검사 사이트 미르다테 2024.12.30 107
38 도커(Docker)로 Stirling-PDF 서버 설치하기 미르다테 2024.12.30 340
37 도커(Docker)로 이윰빌더(Eyoom)+그누보드 설치하기(한국형 게시판 커뮤니티) file 미르다테 2024.12.30 298
36 도커 컨테이너 내의 파일 가져오기, 로컬 파일 도커 컨테이너로 파일 넣기 미르다테 2024.12.30 190
위로