Langsung ke konten utama

Proxy VPS - Proxy Docker - Proxy Container

Setting proxy di VPS yang tidak punya IP Public:

$ sudo nano /etc/environment 

Tambahkan
http_proxy=http://10.210.9.74:8888
https_proxy=https://10.210.9.74:8888

Acquire::http::proxy "http://10.210.9.74:8888";
Acquire::https::proxy "https://10.210.9.74:8888";


Setting proxy di Docker:

$ nano /etc/default/docker

Tambahkan
export http_proxy="http://10.210.9.74:8888"
export https_proxy="https://10.210.9.74:8888"

$ sudo service docker stop
$ sudo service docker start


Setting proxy di container (menggunakan docker-compose.yml):
services:
  api:
    environment:
      http_proxy: http://10.210.9.74:8888
      https_proxy: https://10.210.9.74:8888
    image: qisme:v249
    ports:
    - 80:1000/tcp
    restart: always
    volumes:
    - /home/qisme:/api:rw

Komentar