Обсуждение: Enable development via Docker

Поиск
Список
Период
Сортировка

Enable development via Docker

От
Richard Yen
Дата:
Hi,

After briefly discussing with J. Katz on Slack, I just thought I'd share a few Docker-related files to make it easier to spin up development environments for the website.  Hope this might prove to be useful.

Cheers,
--Richard


Вложения

Re: Enable development via Docker

От
Magnus Hagander
Дата:
On Sat, Feb 22, 2020 at 10:02 PM Richard Yen <richyen3@gmail.com> wrote:
>
> Hi,
>
> After briefly discussing with J. Katz on Slack, I just thought I'd share a few Docker-related files to make it easier
tospin up development environments for the website.  Hope this might prove to be useful.
 

First of all, I like this idea -- anything making dev easier is a
strong win here!

Your second file is named "load varnish", but does not contain
anything about varnish at all -- did you forget something there?

To be properly productive I think we need to figure out a way to load
some more data into the system though. In particular, we need at least
some news, events and *releases* on the frontpage to make it relevant
at all. And probably at least one batch of documentation..

Not entirely sure about how to source that data though, we probably
don't want to stick it in as fixtures since it's data that changes.
Perhaps have a cronjob somewhere on the production system that dumps
out a "useful dump" once a week or so and have the scripts somehow
download (and cache) that?

//Magnus



Re: Enable development via Docker

От
Richard Yen
Дата:


On Sun, Feb 23, 2020 at 6:27 AM Magnus Hagander <magnus@hagander.net> wrote:
On Sat, Feb 22, 2020 at 10:02 PM Richard Yen <richyen3@gmail.com> wrote:
>
> Hi,
>
> After briefly discussing with J. Katz on Slack, I just thought I'd share a few Docker-related files to make it easier to spin up development environments for the website.  Hope this might prove to be useful.

First of all, I like this idea -- anything making dev easier is a
strong win here!

Thanks!  Glad this might help you guys out.  I know there are more improvements to be made on these patches, so I'll work on them.
 
Your second file is named "load varnish", but does not contain
anything about varnish at all -- did you forget something there?

Varnish is loaded in the *.sql files in the sql/ folder.  I included that as a part of the postgres container's initdb mount.  Granted, there's more logic to be handled because there's the dev version of the varnish plpgsql functions that need to be loaded v. the prod version.  I'll work on that when I get a chance--look for a more comprehensive patch to come through this thread.

To be properly productive I think we need to figure out a way to load
some more data into the system though. In particular, we need at least
some news, events and *releases* on the frontpage to make it relevant
at all. And probably at least one batch of documentation..

Yeah, I can also generate that info.  Would there be some sample data that I can work with?  Is a dump of this data somewhere?  I couldn't find it on git.postgresql.org (or maybe I didn't look hard enough) 

Cheers,
--Richard

Re: Enable development via Docker

От
Richard Yen
Дата:


On Sun, Feb 23, 2020 at 4:02 PM Richard Yen <richyen3@gmail.com> wrote:

On Sun, Feb 23, 2020 at 6:27 AM Magnus Hagander <magnus@hagander.net> wrote:

Your second file is named "load varnish", but does not contain
anything about varnish at all -- did you forget something there?

Varnish is loaded in the *.sql files in the sql/ folder.  I included that as a part of the postgres container's initdb mount.  Granted, there's more logic to be handled because there's the dev version of the varnish plpgsql functions that need to be loaded v. the prod version.  I'll work on that when I get a chance--look for a more comprehensive patch to come through this thread.

Just to follow up on this -- in sql/ there's a varnish.sql and a varnish_local.sql.  Is there a reason to use varnish_local.sql instead of varnish.sql while developing?  It's just a bunch of no-op functions, but I can't seem to see a clear advantage of using varnish_local.sql instead of varnish.sql -- it's not like it would hamper development or otherwise make it difficult, would it? Can we do away with varnish_local.sql?

Cheers,
--Richard

Re: Enable development via Docker

От
Magnus Hagander
Дата:
On Wed, Feb 26, 2020 at 2:50 AM Richard Yen <richyen3@gmail.com> wrote:
>
>
>
> On Sun, Feb 23, 2020 at 4:02 PM Richard Yen <richyen3@gmail.com> wrote:
>>
>>
>> On Sun, Feb 23, 2020 at 6:27 AM Magnus Hagander <magnus@hagander.net> wrote:
>>>
>>>
>>> Your second file is named "load varnish", but does not contain
>>> anything about varnish at all -- did you forget something there?
>>
>>
>> Varnish is loaded in the *.sql files in the sql/ folder.  I included that as a part of the postgres container's
initdbmount.  Granted, there's more logic to be handled because there's the dev version of the varnish plpgsql
functionsthat need to be loaded v. the prod version.  I'll work on that when I get a chance--look for a more
comprehensivepatch to come through this thread. 
>
>
> Just to follow up on this -- in sql/ there's a varnish.sql and a varnish_local.sql.  Is there a reason to use
varnish_local.sqlinstead of varnish.sql while developing?  It's just a bunch of no-op functions, but I can't seem to
seea clear advantage of using varnish_local.sql instead of varnish.sql -- it's not like it would hamper development or
otherwisemake it difficult, would it? Can we do away with varnish_local.sql? 

Not really, I think -- not anymore. It used to be a bigger difference
-- when we used pgq it removed a dependency on that.

The only downside now is that your table for varnish purges will
eventually fill up, if you keep at it long enough :)

--
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/