-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dartsass for publisher css compilation #770
Conversation
@@ -44,7 +44,7 @@ services: | |||
BINDING: 0.0.0.0 | |||
expose: | |||
- "3000" | |||
command: bin/rails s --restart | |||
command: bin/dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something that is a bit weird about this approach (and appreciate horse has bolted for a bunch of our repos) is that bin/dev is going to be managing multiple processes which isn't typical behaviour for docker. It raises quite a wtf for apps like this where there is also a worker process - why have that managed differently in docker to css?
We should also manage all dev processes from the Procfile so the worker process should also be defined there, not just web and css.
I'd suggest you take the approach we've done in govuk-chat and have each individual process be it's own docker process:
govuk-docker/projects/govuk-chat/docker-compose.yml
Lines 50 to 54 in 9604d0b
command: bin/dev web | |
govuk-chat-css: | |
<<: *govuk-chat | |
command: bin/dev css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried this approach locally and found that it does not run Sass in watch mode (as described here). I don't know if that is inherent in the approach or if it requires a change in this file to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will be running the exact same process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the latter you need to execute publisher-css as a separate process and/or flag it as a dependency of the process - as per how the worker is configured,
- publisher-worker |
The former example you've got there is unconventional for docker as it's managing 2 processes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that's making sense (and also working as expected 😄) so I have updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 😄 you'll just need to edit:
govuk-docker/projects/publisher/docker-compose.yml
Lines 33 to 39 in 1de6d85
depends_on: | |
- redis | |
- mongo-3.6 | |
- nginx-proxy | |
- publishing-api-app | |
- link-checker-api-app | |
- publisher-worker |
to include publisher-css, which will mean that css is automatically started when web is started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, have done that as well. 👍
bda351e
to
9fbfaea
Compare
abee6ff
to
db3bf12
Compare
6630051
to
ca1cace
Compare
What
Change docker compose for Mainstream Publisher to match compilation of CSS using dart-sass. See alphagov/publisher#2278.
Why
We're switching these apps from libsass to dart-sass, and this change is needed to support that.