Official Docker support #1147

Closed
opened 2019-08-01 00:12:37 +00:00 by pea · 9 comments
Member

Started talking with lain about making an official Docker image (and possibly docker-compose.yml) with OTP Releases being a thing now a little bit back.

I've started work on this in my fork, thinking of splitting it into a couple of separate MRs, one each for the:

  • Dockerfile (#4905)
  • Gitlab CI integration
  • and docker-compose.yml (possibly a couple different ones of these for different configurations? docker-compose.traefik.yml, etc)

If anyone would prefer this to be batched differently let me know, but I'm currently starting with just the Dockerfile.

Started talking with lain about making an official Docker image (and possibly docker-compose.yml) with OTP Releases being a thing now a little bit back. I've started work on this in my fork, thinking of splitting it into a couple of separate MRs, one each for the: - [x] Dockerfile (#4905) - [ ] Gitlab CI integration - [ ] and docker-compose.yml (possibly a couple different ones of these for different configurations? docker-compose.traefik.yml, etc) If anyone would prefer this to be batched differently let me know, but I'm currently starting with just the Dockerfile.
Member

Hi. I'm using this Dockerfile on stable branch.

I found that :markup settings in /var/lib/pleroma/config.exs won't apply.

example:

config :pleroma, :markup,
  allow_headings: true,
  allow_fonts: true

I'm not familiar with Elixir, but I think the cause is that Pleroma.HTML.Scrubber.Default is implemented with many macros and macros are expanded in mix release, so the config cannot apply to the expanded macros.

Hi. I'm using [this Dockerfile on stable branch](https://git.pleroma.social/pleroma/pleroma/blob/a43b899e94c499a9b5cb1a072fe4b96f0f02696f/Dockerfile). I found that `:markup` settings in `/var/lib/pleroma/config.exs` won't apply. example: ```elixir config :pleroma, :markup, allow_headings: true, allow_fonts: true ``` I'm not familiar with Elixir, but I think the cause is that `Pleroma.HTML.Scrubber.Default` is implemented with many macros and macros are expanded in `mix release`, so the config cannot apply to the expanded macros.
Member

I'm not familiar with Elixir, but I think the cause is that Pleroma.HTML.Scrubber.Default is implemented with many macros and macros are expanded in mix release, so the config cannot apply to the expanded macros.

You are correct. Not sure how we could fix this though

> I'm not familiar with Elixir, but I think the cause is that `Pleroma.HTML.Scrubber.Default` is implemented with many macros and macros are expanded in `mix release`, so the config cannot apply to the expanded macros. You are correct. Not sure how we could fix this though

@plataformatec do you guys know a way around this?

@plataformatec do you guys know a way around this?
Member

I'm not familiar with Elixir, but I think the cause is that Pleroma.HTML.Scrubber.Default is implemented with many macros and macros are expanded in mix release, so the config cannot apply to the expanded macros.

Yes. That's correct. This code here will be evaluated at compile time so if you need to set up any of those config values you need to do it before running mix release here. In case those config values are only available at runtime then you need to avoid macros for this.

> I'm not familiar with Elixir, but I think the cause is that `Pleroma.HTML.Scrubber.Default` is implemented with many macros and macros are expanded in `mix release`, so the config cannot apply to the expanded macros. Yes. That's correct. This code [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/lib/pleroma/html.ex#L239-249) will be evaluated at compile time so if you need to set up any of those config values you need to do it before running `mix release` [here](https://git.pleroma.social/pleroma/pleroma/blob/a43b899e94c499a9b5cb1a072fe4b96f0f02696f/Dockerfile#L13). In case those config values are only available at runtime then you need to avoid macros for this.

Related to #1760

Related to #1760

don't we have this fixed by now, @rinpatch ?

don't we have this fixed by now, @rinpatch ?
Member

The scrubber thing - yeah. Docker - no idea

The scrubber thing - yeah. Docker - no idea
Member

Hey everyone,

Since you have this repo, can you merge into the main pleroma repo and make an official docker tutorial in the docs?

Hey everyone, Since you have this [repo](https://git.pleroma.social/pleroma/pleroma-docker-compose), can you merge into the main pleroma repo and make an official docker tutorial in the docs?

Closing as likely fixed. Evidence: origin/develop contains Dockerfile, docker-entrypoint.sh, .dockerignore; CHANGELOG: 'Update Dockerfile to use Elixir 1.17.3... to match CI release builds', 'Add instructions on how to run a release in docker'. Please reopen or file a fresh issue if this still occurs on a current release.

Closing as likely fixed. Evidence: origin/develop contains Dockerfile, docker-entrypoint.sh, .dockerignore; CHANGELOG: 'Update Dockerfile to use Elixir 1.17.3... to match CI release builds', 'Add instructions on how to run a release in docker'. Please reopen or file a fresh issue if this still occurs on a current release.
Sign in to join this conversation.
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/pleroma#1147
No description provided.