-
Notifications
You must be signed in to change notification settings - Fork 0
Add Docker Compose and Dev Containers #32
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
Conversation
Can now develop without having to set up postgres yourself
@@ -0,0 +1,16 @@ | |||
FROM python:3.12-slim | |||
|
|||
RUN apt-get update \ |
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.
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
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 don't want to change the prod Docker image in this PR but I'll note this for later
RUN apt-get update \ | ||
&& apt-get install -y libpq-dev gcc postgresql-client git |
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.
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/* |
RUN pip install -r requirements.txt | ||
|
||
COPY . . | ||
|
||
RUN pip install -e . |
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.
Again super nitpicky https://github.com/hadolint/hadolint/wiki/DL3042
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 |
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.
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)
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.
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.
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.
Looks good 👍
Can now develop without having to set up postgres yourself