Skip to content

Instantly share code, notes, and snippets.

@miathedev
Forked from ejhari/Dockerfile
Created November 7, 2018 20:02
Show Gist options
  • Save miathedev/5aa82db3dbe534cb3c5c862e905b7555 to your computer and use it in GitHub Desktop.
Save miathedev/5aa82db3dbe534cb3c5c862e905b7555 to your computer and use it in GitHub Desktop.
GitLab CE with Postfix Send Only via Docker
# REF: http://docs.gitlab.com/omnibus/docker/
# REF: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04
# REF: https://github.com/denouche/docker-gitlab/blob/master/Dockerfile
web:
image: 'myrepo/gitlab-ce-postfix-send-only'
restart: always
hostname: 'mysubdomain.mydomain.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://mysubdomain.mydomain.com'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '80:80'
- '443:443'
- '10022:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
- '/srv/gitlab/postfix/main.cf:/etc/postfix/main.cf'
- '/srv/gitlab/postfix/aliases:/etc/aliases'
FROM gitlab/gitlab-ce:latest
RUN echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections \
&& echo "postfix postfix/mailname string mysubdomain.mydomain.com" | debconf-set-selections \
&& apt-get install -y postfix
RUN apt-get install -y \
mailutils
RUN grep -q postfix-start.sh /assets/wrapper || sed -i \
'/# Wait for SIGTERM/i # Start postfix service.\nservice postfix start\n' /assets/wrapper
CMD ["/assets/wrapper"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment