Skip to content

Commit

Permalink
check: docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
archmagece committed Aug 27, 2024
1 parent 081d940 commit 643a28b
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ vendor/
tmp/
~tmp/
~/
tmpconf/
6 changes: 6 additions & 0 deletions configs/global_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ func (cfg *GlobalConfig) ReadConfig() {
confDir := helpers.GetEnv("CONFIG_DIR", "conf/")
helpers.ReadYaml(path.Join(confDir, "global.yaml"), cfg)

cfg.BaseDir = helpers.GetEnv("BASE_DIR", cfg.BaseDir)
if cfg.BaseDir == "" {
cfg.BaseDir = "~/tmp/deproxy"
}
if strings.HasPrefix(cfg.BaseDir, "~") {
//homeDir, err := os.UserHomeDir()
//if err != nil {
// fmt.Printf("Error retrieving home directory: %v\n", err)
// return
//}
cfg.BaseDir = helpers.ExpandHome(cfg.BaseDir)
}
}
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
services:
deproxy:
build:
context: .
dockerfile: Dockerfile
container_name: deproxy
ports:
- "8080:8080"
volumes:
- ./tmpconf/:/tmpconf
- base_volume:/storage
# - proxy_volume:/storage/cachedir
# - mirror_volume:/storage/mirrordir
environment:
- BASE_DIR=/storage
# - CACHE_DIR=~/tmp/storage/cachedir
# - MIRROR_DIR=~/tmp/storage/mirrordir
- CONFIG_DIR=/tmpconf

volumes:
base_volume:
# proxy_volume:
# mirror_volume:
15 changes: 15 additions & 0 deletions tmpconf/apt-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
path: mirror/apt

mirrors:
ubuntu:
official:
url: http://archive.ubuntu.com/ubuntu
kakao:
url: http://mirror.kakao.com/ubuntu
ubuntu-security:
url: http://security.ubuntu.com/ubuntu
debian:
official:
url: http://ftp.debian.org/debian
kakao:
url: http://mirror.kakao.com/debian
18 changes: 18 additions & 0 deletions tmpconf/apt-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
path: proxy/apt

#cache:
# enabled: false
# retention_time: 1h
# evict: 1h

proxies:
ubuntu:
- name: official
url: http://archive.ubuntu.com/ubuntu
- name: kakao
url: http://mirror.kakao.com/ubuntu
- name: ubuntu-security
url: http://security.ubuntu.com/ubuntu
debian:
- name: official
url: http://ftp.debian.org/debian
26 changes: 26 additions & 0 deletions tmpconf/github-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#path: ~/tmp/mirror/git
#
#workpath: ~/mymirror
#
## naming은... github/{user}/{repo}를 기본으로
## 아니면
## repoanme만 쓸 수 있으면 쓰고..
## {user}-{repo} 안되는 경우
#
#mirrors:
# github:
# zitryss:
# groups: ['go']
# repos:
# go-sample:
# # branch: master
# groups: ['git', 'go']
# PersonaIam:
# groups: ['coin']
# repos:
# persona-client:
# groups: ['coin', 'go']
# streamlit:
# groups: ['coin', 'python']
# repos:
# streamlit:
8 changes: 8 additions & 0 deletions tmpconf/global.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#proxy:
# http: 192.168.11.99:3128
# https: 192.168.11.99:3129

#if base_dir set? proxy, mirror relative
base_dir: ~/tmp/deproxy
#proxy_root: ~/tmp/proxy
#mirror_root: ~/tmp/mirror
9 changes: 9 additions & 0 deletions tmpconf/maven-host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#path: ~/tmp/data/maven/
#
#repositories:
# company-dev:
# snapshot: true
# overwrite: true
# company-prd:
# snapshot: false
# overwrite: false
22 changes: 22 additions & 0 deletions tmpconf/maven-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
path: mirror/maven
use_cache: true
# https://docs.gradle.org/current/userguide/declaring_repositories.html

mirrors:
central:
name: maven-center
url: https://repo.maven.apache.org/maven2/
description: "maven centeral"
jcenter:
name: jcenter
url: https://jcenter.bintray.com
google:
name: google
url: https://maven.google.com
spring_release:
name: repo.spring.io-releases
url: https://repo.spring.io/release
spring_snapshots:
name: repo.spring.io-snapshots
url: https://repo.spring.io/snapshot

29 changes: 29 additions & 0 deletions tmpconf/maven-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
path: proxy/maven
use_cache: true
# https://docs.gradle.org/current/userguide/declaring_repositories.html

proxies:
- name: Maven Center
id: maven-center
url: https://repo.maven.apache.org/maven2/
description: "maven centeral"
- name: jcener
id: jcenter
url: https://jcenter.bintray.com
- name: google
id: google
url: https://maven.google.com
# https://repo.spring.io/webapp/#/home
- name: spring_release
id: repo.spring.io-releases
url: https://repo.spring.io/release
- name: spring_snapshots
id: repo.spring.io-snapshots
url: https://repo.spring.io/snapshot

# company_internal:
# url: http://company
# description: "my company"
# auth:
# method: BASIC
# username:
20 changes: 20 additions & 0 deletions tmpconf/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#users:
# - name: admin
# password: passw0rd
# roles: [ admin ]
# - name: user
# password: passw0rd
# roles: [ user, deploy ]
#
#roles:
# admin:
# permissions:
# - *
# developer:
# permissions:
# - read
# - write
# - deploy
# deployer:
# permissions:
# - deploy
8 changes: 8 additions & 0 deletions tmpconf/vagrant-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#cache:
# relative: false
# path: /proxy/vagrant
#
#servers:
# - id: official
# name: Official
# url: http://official

0 comments on commit 643a28b

Please sign in to comment.