#3024 Improve docker-compose and documentation
Merged 6 years ago by pingou. Opened 6 years ago by farhaan.
farhaan/pagure improve-compose  into  master

file modified
+4
@@ -57,6 +57,10 @@ 

  

  Docker Compose

  ^^^^^^^^^^^^^^

+ Create the folder that will receive the projects, forks, docs, requests and

+ tickets' git repo::

+ 

+     mkdir -p lcl/{repos,remotes,attachments,releases}

  

  A docker compose environment is available to run pagure. First use the following

  command to build the containers. ::

file modified
+4 -16
@@ -13,14 +13,8 @@ 

      ports:

        - "5000:5000"

      volumes:

-       - type: volume

-         source: ../lcl/repos

-         target: /repos

-         read_only: false

-       - type: volume

-         source: ../lcl/attachments

-         target: /attachments

-         read_only: false

+       - ../lcl/repos:/repos

+       - ../lcl/attachments:/attachments

        - ..:/code:z

    worker:

      build:
@@ -31,14 +25,8 @@ 

        - postgresql

      image: pagure-worker:latest

      volumes:

-       - type: volume

-         source: ../lcl/repos

-         target: /repos

-         read_only: false

-       - type: volume

-         source: ../lcl/attachments

-         target: /attachments

-         read_only: true

+       - ../lcl/repos:/repos

+       - ../lcl/attachments:/attachments:ro

        - ..:/code:z

      environment:

        - PYTHONPATH=.

file modified
+11 -11
@@ -289,17 +289,17 @@ 

              pagure_config['DOMAIN_EMAIL_NOTIFICATIONS'])

          msg['Mail-Followup-To'] = msg['Reply-To']

          if not pagure_config.get('EMAIL_SEND', True):

-             print('******EMAIL******')

@pingou any reason we used print statement here ?

I'm wondering if this isn't from time where we were using much less logging

-             print('From: %s' % from_email)

-             print('To: %s' % to_mail)

-             print('Subject: %s' % subject)

-             print('in_reply_to: %s' % in_reply_to)

-             print('mail_id: %s' % mail_id)

-             print('Contents:')

-             print(text.encode('utf-8'))

-             print('*****************')

-             print(msg.as_string())

-             print('*****/EMAIL******')

+             _log.debug('******EMAIL******')

This isn't quite related to docker :)

in a way yes because it is not easy to get stdout using docker-compose.

+             _log.debug('From: %s', from_email)

+             _log.debug('To: %s', to_mail)

+             _log.debug('Subject: %s', subject)

+             _log.debug('in_reply_to: %s', in_reply_to)

+             _log.debug('mail_id: %s', mail_id)

+             _log.debug('Contents:')

+             _log.debug(text.encode('utf-8'))

+             _log.debug('*****************')

+             _log.debug(msg.as_string())

+             _log.debug('*****/EMAIL******')

              continue

          try:

              if smtp is None:

This commits makes the current docker-compose.yml to work with the latest version of docker-compose, documentation on creating the initial directories are added to the docker-compose section.

Signed-off-by: Farhaan Bukhsh farhaan.bukhsh@gmail.com

rebased onto 6b377558ac41dcb7bbeb5943fbf4ae6c3d24fe37

6 years ago

it is missing the read_only set to true here.
I think ../lcl/attachments:/attachments:ro should work

@pingou any reason we used print statement here ?

This isn't quite related to docker :)

One comment and one question :) but looks good otherwise

in a way yes because it is not easy to get stdout using docker-compose.

I'm wondering if this isn't from time where we were using much less logging

Alright, let's rebase and merge :)

Awesome I will fix and rebase it :smile:

rebased onto a2549f3

6 years ago

got the wrong one :) it needs to be on the worker not the web service

Damn I am really sorry

2 new commits added

  • Replace print with debug logs
  • Improve docker-compose and documentation
6 years ago

Pull-Request has been merged by pingou

6 years ago