Skip to content
Snippets Groups Projects
Commit 5168b042 authored by Pierre-Gilles Levallois's avatar Pierre-Gilles Levallois
Browse files

just another test more & more

parent fa2b6e86
No related branches found
No related tags found
2 merge requests!3Launch script,!2Refactoring : all scripts in Dockerfiles/python/scripts
Pipeline #44272 passed
# # ARB::Base de données postgis pour le calcul du calque de plantabilité # ARB::Base de données postgis pour le calcul du calque de plantabilité
# FROM postgis/postgis FROM postgis/postgis
# # Create another dir for pgdata than /var/postgresql/data/ # Create another dir for pgdata than /var/postgresql/data/
# # see http://heidloff.net/article/deploying-postgres-on-openshift/ # see http://heidloff.net/article/deploying-postgres-on-openshift/
# USER root USER root
# ENV PGDATA=/var/lib/postgresql/data/pgdata # ENV PGDATA=/var/lib/postgresql/data/pgdata
# # RUN mkdir arb-data ENV PGDATA=/arb-data/pgdata
# RUN groupadd non-root-postgres-group && \ # RUN groupadd non-root-postgres-group && \
# useradd non-root-postgres-user --group non-root-postgres-group && \ # useradd non-root-postgres-user --group non-root-postgres-group && \
# mkdir -p $PGDATA && \ RUN mkdir -p $PGDATA && \
# chown -R non-root-postgres-user:non-root-postgres-group /$PGDATA && \ chown -R postgres:0 /$PGDATA && \
# chmod 777 /$PGDATA chmod 777 /$PGDATA
# # Entry point.
# COPY ./db-init/ /docker-entrypoint-initdb.d/
# RUN ls -l /docker-entrypoint-initdb.d/ # Entry point.
COPY ./db-init/ /docker-entrypoint-initdb.d/
# USER non-root-postgres # USER non-root-postgres
FROM mdillon/postgis:10-alpine # FROM mdillon/postgis:10-alpine
# USER root
USER root # RUN chown postgres:0 -R ${PGDATA}
# COPY ./db-init/ /docker-entrypoint-initdb.d/
RUN chown postgres:0 -R ${PGDATA}
COPY ./db-init/ /docker-entrypoint-initdb.d/
USER postgres USER postgres
\ No newline at end of file
...@@ -64,7 +64,8 @@ spec: ...@@ -64,7 +64,8 @@ spec:
value: "__POSTGRES_SCHEMA__" value: "__POSTGRES_SCHEMA__"
# need to define PGDATA env var because not using the default /var/lib/postgresql/data, but a subpath under it. # need to define PGDATA env var because not using the default /var/lib/postgresql/data, but a subpath under it.
- name: PGDATA - name: PGDATA
value: /var/lib/postgresql/data/pgdata # value: /var/lib/postgresql/data/pgdata
value: /arb-data/pgdata
volumeMounts: volumeMounts:
# need a subpath as postgres wants an empty folder (the mounted folder `/var/lib/postgresql/data` has a `lost+found` directory) # need a subpath as postgres wants an empty folder (the mounted folder `/var/lib/postgresql/data` has a `lost+found` directory)
# see https://stackoverflow.com/questions/51168558/how-to-mount-a-postgresql-volume-using-aws-ebs-in-kubernete # see https://stackoverflow.com/questions/51168558/how-to-mount-a-postgresql-volume-using-aws-ebs-in-kubernete
...@@ -72,6 +73,6 @@ spec: ...@@ -72,6 +73,6 @@ spec:
# the owner:group of this folder is 70:70 (postgres:postgres), done by this step in the docker image: # the owner:group of this folder is 70:70 (postgres:postgres), done by this step in the docker image:
# https://github.com/docker-library/postgres/blob/master/Dockerfile-alpine.template#L146 # https://github.com/docker-library/postgres/blob/master/Dockerfile-alpine.template#L146
- name: db-data - name: db-data
mountPath: "/var/lib/postgresql/data/pgdata" mountPath: "/arb-data/pgdata"
subpath: pgdata subpath: pgdata
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment