Skip to content

Commit

Permalink
updates for latest docker networking! remove links, use compose-creat…
Browse files Browse the repository at this point in the history
…ed network

use env variable in compose
  • Loading branch information
ikreymer committed Nov 6, 2015
1 parent 8649c80 commit 26c9635
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api_version: '1.18'
api_version: '1.21'
vnc_port: 6080
cmd_port: 6082

Expand Down
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def new_container(self, browser, env=None, default_host=None):

res = self.cli.start(container=id_,
port_bindings={self.VNC_PORT: None, self.CMD_PORT: None},
links={self.PYWB_HOST: self.PYWB_HOST,
self.LOCAL_REDIS_HOST: self.LOCAL_REDIS_HOST},
volumes_from=['netcapsule_shared_data_1'],
)

self.cli.connect_container_to_network(id_, 'netcapsule')

info = self.cli.inspect_container(id_)
ip = info['NetworkSettings']['IPAddress']

Expand Down
22 changes: 8 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
pywb:
build: ./pywb
restart: always
links:
- redis
- memgator

environment:
- ARCHIVE_JSON=http://webenact.rhizome.org/collinfo.json
#volumes:
# - ./archives.json:/archives.json
- ARCHIVE_JSON=${ARCHIVE_JSON}

volumes:
- ./archives.json:/archives.json

memgator:
# image: ibnesayeed/memgator
image: ikreymer/memgator
image: ibnesayeed/memgator:master
restart: always

command: --arcs=http://webenact.rhizome.org/collinfo.json server
command: --arcs=${ARCHIVE_JSON} server
ports:
- 1208:1208

#volumes:
# - ./archives.json:/archives.json
volumes:
- ./archives.json:/archives.json

redis:
image: redis:latest
Expand All @@ -35,8 +31,6 @@ shared_data:
app:
build: ./app
restart: always
links:
- redis

volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
3 changes: 0 additions & 3 deletions pywb/archivereplayview.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,11 @@ def _get_urls_to_try(self, cdx, skip_hosts, wbrequest):
raise CaptureException('Skipping already failed: ' + src_url)

info = self.find_archive_info(src_url)
print(src_url)
print(info)

if info and info.get('unrewritten_url'):
orig_url = info['unrewritten_url'].format(timestamp=cdx['timestamp'],
url=cdx['url'])
try_urls = [orig_url]
print(try_urls)
else:
try_urls = [src_url]

Expand Down

0 comments on commit 26c9635

Please sign in to comment.