forked from heroku/heroku-buildpack-ci-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (16 loc) · 690 Bytes
/
Dockerfile
File metadata and controls
20 lines (16 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ARG BASE_IMAGE
FROM $BASE_IMAGE
ARG STACK
ARG POSTGRESQL_VERSION
# initdb and pg_ctl error if run as root.
RUN useradd -m -d /app non-root-user
RUN mkdir -p /app /cache /env
RUN chown non-root-user /app /cache /env
USER non-root-user
RUN [ -z "${POSTGRESQL_VERSION}" ] || echo "${POSTGRESQL_VERSION}" > /env/POSTGRESQL_VERSION
COPY --chown=non-root-user . /buildpack
WORKDIR /app
# Sanitize the environment seen by the buildpack, to prevent reliance on
# environment variables that won't be present when it's run by Heroku CI.
RUN env -i PATH=$PATH HOME=$HOME STACK=$STACK /buildpack/bin/detect /app
RUN env -i PATH=$PATH HOME=$HOME STACK=$STACK /buildpack/bin/compile /app /cache /env