Skip to content

Commit

Permalink
Changed container host port
Browse files Browse the repository at this point in the history
  • Loading branch information
erjac77 committed Nov 17, 2019
1 parent f1f0545 commit 2bef905
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
7 changes: 4 additions & 3 deletions tasks/Docker/install_gogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
image: "{{ gogs_container_image }}"
state: started
published_ports:
- "{{ gogs_container_http_host_port }}:{{ gogs_container_http_container_port }}"
- "{{ gogs_container_ssh_host_port }}:{{ gogs_container_ssh_container_port }}"
- "{{ gogs_http_port }}:{{ gogs_container_http_port }}"
- "{{ gogs_ssh_port }}:{{ gogs_container_ssh_port }}"
volumes:
- "{{ gogs_container_data_volume }}:/data"
register: gogs_container_result

- include: ./../wait.yml
- name: Wait for Gogs to start up
include_tasks: ./../wait.yml
10 changes: 5 additions & 5 deletions tasks/configure_gogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
repo_root_path: "{{ gogs_repo_root_path }}"
run_user: "{{ gogs_user }}"
domain: "{{ gogs_hostname }}"
ssh_port: "{{ gogs_container_ssh_container_port if gogs_platform == 'Docker' else gogs_ssh_port }}"
http_port: "{{ gogs_container_http_container_port if gogs_platform == 'Docker' else gogs_http_port }}"
# yamllint disable-line rule:line-length
app_url: "http://{{ gogs_hostname }}:{{ gogs_container_http_container_port if gogs_platform == 'Docker' else gogs_http_port }}/"
ssh_port: "{{ gogs_ssh_port }}"
http_port: "{{ gogs_http_port }}"
app_url: "http://{{ gogs_hostname }}:{{ gogs_http_port }}/"
log_root_path: "{{ gogs_log_path }}"
enable_captcha: "{{ gogs_enable_captcha }}"
admin_name: "{{ gogs_admin_username }}"
Expand All @@ -31,7 +30,8 @@
register: gogs_install_resp
changed_when: gogs_install_resp.status == 302

- include: wait.yml
- name: Wait for Gogs to start up
include_tasks: ./../wait.yml

- name: Get access token
uri:
Expand Down
2 changes: 1 addition & 1 deletion tasks/wait.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Wait for Gogs to start up
- name: Try to access Gogs
uri:
url: "http://{{ gogs_hostname }}:{{ gogs_http_port }}/"
status_code: 200
Expand Down
6 changes: 2 additions & 4 deletions vars/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ gogs_repo_root_path: /data/git/gogs-repositories
# Gogs Docker container settings
gogs_container_name: gogs
gogs_container_image: gogs/gogs
gogs_container_http_host_port: "{{ gogs_http_port }}"
gogs_container_http_container_port: 3000
gogs_container_ssh_host_port: "{{ gogs_ssh_port }}"
gogs_container_ssh_container_port: 22
gogs_container_http_port: 3000
gogs_container_ssh_port: 22
gogs_container_data_volume: gogs-data

0 comments on commit 2bef905

Please sign in to comment.