Skip to content
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

Add Dockerfile #34

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@daurnimator
Copy link
Member

daurnimator commented Jan 7, 2019

This PR adds a dockerfile so that userdb can be installed using a kubernetes job.

@drGrove

This comment has been minimized.

Copy link
Member

drGrove commented Jan 8, 2019

Should we get ignoring any files? I'd assume we'd want to ignore .git at the minimum

@daurnimator

This comment has been minimized.

Copy link
Member Author

daurnimator commented Jan 9, 2019

Should we get ignoring any files? I'd assume we'd want to ignore .git at the minimum

Good idea; should add a .dockerignore file in this PR.

@drGrove

This comment has been minimized.

Copy link
Member

drGrove commented Apr 15, 2019

@daurnimator please add a .dockerignore to this PR.

RUN /userdb/json-schemas.py

FROM alpine:latest
RUN apk --no-cache add make postgresql-client

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

After installing create a new user and drop into that user.


FROM alpine:latest
RUN apk --no-cache add make postgresql-client
ADD . /userdb

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

Change this to:

COPY --chown=<user>:<user> . /home/<user>/userdb
FROM alpine:latest
RUN apk --no-cache add make postgresql-client
ADD . /userdb
COPY --from=gen_schemas /userdb/json-schemas.sql.tmp /userdb/json-schemas.sql.tmp

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

Update path as per above

RUN apk --no-cache add make postgresql-client
ADD . /userdb
COPY --from=gen_schemas /userdb/json-schemas.sql.tmp /userdb/json-schemas.sql.tmp
WORKDIR /userdb

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

When you drop into the user, you can set the workdir there. Moving this unchanging layer higher up

RUN /userdb/json-schemas.py

FROM alpine:latest
RUN apk --no-cache add make postgresql-client

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

Pin version so multiple builds can be verified

WORKDIR /userdb
RUN /userdb/json-schemas.py

FROM alpine:latest

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

Avoid using latest.

@@ -0,0 +1,12 @@
FROM python:alpine AS gen_schemas
RUN pip install --no-cache-dir PyYAML

This comment has been minimized.

Copy link
@drGrove

drGrove Apr 15, 2019

Member

Pin version of PyYAML

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.