GithubHelp home page GithubHelp logo

Comments (7)

pe-pan avatar pe-pan commented on June 26, 2024 10

Actually, I still believe, this is an issue of either docker, docker-compose or mattermost docker file. I have encountered exactly the same and IMHO, editting the provided files with my company proxy settings is just a workaround but not a proper fix. The docker-compose (or whatever) should take those proxy settings from the system / docker proxy settings.

from mattermost-docker.

mszacun avatar mszacun commented on June 26, 2024 2

The fact I need to keep my environment variables input in two seperate places is quite riddiculous. .env content should be present in the sstem right from the beginning of image building.

from mattermost-docker.

xcompass avatar xcompass commented on June 26, 2024 1

@Niceplace if you are deploying mattermost, you can use auto built images: https://hub.docker.com/r/mattermost/mattermost-prod-app/, https://hub.docker.com/r/mattermost/mattermost-prod-db/, https://hub.docker.com/r/mattermost/mattermost-prod-web/ so that you can get around with your firewall.

Also if you want to build the image but get 404, it might not be your file cause it seems that apt-get reached the remote server, but server returned 404. You could try sometime later. There might be a problem with apt repo mirror at the time you were building your image. (I got those errors sometime as well).

from mattermost-docker.

Niceplace avatar Niceplace commented on June 26, 2024

Hi @xcompass thanks for replying !

Thank you for suggesting the official images from dockerhub, I didn't explore this solution !

However, I do like the flexibility to have the Dockerfiles of each individual component as this repo provides so I will share my solution.

Regarding this :

There might be a problem with apt repo mirror at the time you were building your image. (I got those errors sometime as well).

I thought that as well but the second I configured my proxy the errors went away. I tested multiple times to make sure.

Here's my final configuration that works (for building, that is. I have other problems with SSL but that's out of scope here.)

Interesting note : variables in docker-compose MUST NOT contain dashes "-", they aren't evaluated if its the case. I haven't found documentation for this yet ( I didn't search a lot ).

Interesting note 2 : These variables are used in the build context only. At least that's what I understand from the docker-compose documentation.

docker-compose.yml

  • replace my.proxy.address with actual proxy adress
  • replace 1234 with actual proxy port
  • sproxy stands for https_proxy, I got lazy. I know there is an http address there as well, its because our company doesn't have an https proxy.
version: "2"

services:

  db:
    build:
      context: ./db
      args:
        proxy: "http://my.proxy.address:1234"
        sproxy: "http://my.proxy.address:1234"
        noproxy: "localhost,127.0.0.1,$LOCAL_DOMAIN"
    restart: always
    volumes:
      - /app/docker-volumes/mattermost/postgresql/data:/var/lib/postgresql/data
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MM_USERNAME=mmuser
      - MM_PASSWORD=mmuser_password
      - MM_DBNAME=mattermost

  app:
    build:
      context: ./app
      args:
        proxy: "http://my.proxy.address:1234"
        sproxy: "http://my.proxy.address:1234"
        noproxy: "localhost,127.0.0.1,$LOCAL_DOMAIN"
    links:
      - db:db
    restart: always
    volumes:
      - /app/docker-volumes/mattermost/mattermost/config:/mattermost/config:rw
      - /app/docker-volumes/mattermost/mattermost/data:/mattermost/data:rw
      - /etc/localtime:/etc/localtime:ro

  web:
    build:
      context: ./web
      args:
        proxy: "http://my.proxy.address:1234"
        sproxy: "http://my.proxy.address:1234"
        noproxy: "localhost,127.0.0.1,$LOCAL_DOMAIN"
    ports:
      - "11443:443"
    links:
      - app:app
    restart: always
    volumes:
        # This directory must have cert files
      - /app/docker-volumes/mattermost/mattermost/cert:/cert:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MATTERMOST_ENABLE_SSL=true
      - PLATFORM_PORT_80_TCP_PORT=80

Dockerfile (this is the one for web, but the same method was used for app and db)

Notice the ARG to "import" arguments from Dockerfile, and double quotes after this with ENV to interpret the value as a string (I think ?).

FROM ubuntu:14.04

ARG proxy
ARG sproxy
ARG noproxy

ENV http_proxy="$proxy"
ENV https_proxy="$sproxy"
ENV no_proxy="$noproxy"

RUN apt-get update && apt-get install -y nginx

RUN rm /etc/nginx/sites-enabled/default

COPY mattermost /etc/nginx/sites-available/
COPY mattermost-ssl /etc/nginx/sites-available/
ADD docker-entry.sh /

RUN chmod +x /docker-entry.sh

# You can see the logs using `docker-compose logs web`.
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

# Define working directory.
WORKDIR /etc/nginx

ENTRYPOINT /docker-entry.sh

EXPOSE 80 443

from mattermost-docker.

Niceplace avatar Niceplace commented on June 26, 2024

Closing issue because I found a solution.

from mattermost-docker.

xcompass avatar xcompass commented on June 26, 2024

Thanks @Niceplace for the update and solution.

from mattermost-docker.

prisar avatar prisar commented on June 26, 2024

I cannot connect and restore nuget packages behind proxy.

from mattermost-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.