Skip to content

Conversation

jarofgreen
Copy link
Contributor

Can now develop without having to set up postgres yourself

Can now develop without having to set up postgres yourself
@jarofgreen jarofgreen self-assigned this Jun 3, 2025
@@ -0,0 +1,16 @@
FROM python:3.12-slim

RUN apt-get update \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you feel like saving some disk space, it seems these days they recommend clearing apt cache after installing things https://github.com/hadolint/hadolint/wiki/DL3009

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to change the prod Docker image in this PR but I'll note this for later

Comment on lines +3 to +4
RUN apt-get update \
&& apt-get install -y libpq-dev gcc postgresql-client git
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RUN apt-get update \
&& apt-get install -y libpq-dev gcc postgresql-client git
RUN apt-get update \
&& apt-get install --no-install-recommends -y libpq-dev gcc postgresql-client git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Comment on lines +10 to +14
RUN pip install -r requirements.txt

COPY . .

RUN pip install -e .
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again super nitpicky https://github.com/hadolint/hadolint/wiki/DL3042

Suggested change
RUN pip install -r requirements.txt
COPY . .
RUN pip install -e .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN pip install --no-cache-dir -e .

network_mode: service:db
environment:
- DATABASE_URL=postgresql://postgres:postgres@localhost/postgres
entrypoint: sleep infinity
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha so, we don't actually start the app here, but instead the user should shell in and start the app themselves? (I don't really know anything about the ic4ids datastore)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sometimes it's an interesting question about whether we want dev containers to do the thing or let the user do the thing but in this case I think clearly the dev probably wants to adjust something, set up run parameters or change code, and then run the app several times as they do their work.

Copy link

@R2ZER0 R2ZER0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@jarofgreen jarofgreen merged commit 2fc7dca into main Jun 3, 2025
1 check passed
@jarofgreen jarofgreen deleted the dev-containers branch June 3, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants