File tree 4 files changed +35
-4
lines changed
4 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ FROM esgfhub/centos67_python27:latest
6
6
MAINTAINER Luca Cinquini <luca.cinquini@jpl.nasa.gov>
7
7
8
8
# choose CoG version
9
- ENV COG_TAG=v3.6.0
9
+ ENV COG_TAG=v3.6.1
10
10
11
11
# setup CoG environment
12
12
ENV COG_DIR=/usr/local/cog
@@ -48,3 +48,21 @@ RUN cd $COG_DIR && \
48
48
cd mkproxy && \
49
49
make && \
50
50
cp mkproxy $COG_DIR/venv/lib/python2.7/site-packages/globusonline_transfer_api_client-0.10.16-py2.7.egg/globusonline/transfer/api_client/x509_proxy/.
51
+
52
+ # expose default django port
53
+ EXPOSE 8000
54
+
55
+ # create non-privileged user to run django
56
+ RUN groupadd -r cogadmin && \
57
+ useradd -r -g cogadmin cogadmin && \
58
+ mkdir -p ~cogadmin && \
59
+ chown cogadmin:cogadmin ~cogadmin
60
+
61
+ # change user prompt
62
+ RUN echo 'export PS1="[\u @\h ]\$ "' >> ~cogadmin/.bashrc
63
+
64
+ # change ownership of application directories
65
+ RUN chown -R cogadmin:cogadmin $COG_DIR
66
+
67
+ # expose application data (must do this AFTER chown)
68
+ VOLUME $COG_DIR
Original file line number Diff line number Diff line change 1
1
# CoG image configured for ESGF node
2
- FROM esgfhub/cog
2
+ FROM esgfhub/cog:v3.6.1
3
3
4
4
MAINTAINER Luca Cinquini <luca.cinquini@jpl.nasa.gov>
5
5
@@ -47,6 +47,9 @@ RUN echo 'db.host=localhost' >> /esg/config/esgf.properties
47
47
RUN echo 'db.port=5432' >> /esg/config/esgf.properties
48
48
RUN echo 'changeit' >> /esg/config/.esgf_pass
49
49
50
+ # default working directory
51
+ WORKDIR $COG_INSTALL_DIR
52
+
50
53
# start up django+CoG with correct host IP
51
54
COPY ./docker-entrypoint.sh /
52
55
ENTRYPOINT ["/docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change 4
4
source $COG_DIR /venv/bin/activate
5
5
6
6
# start postgres
7
+ # must issue this command as user 'root' becoming user 'postgres'
7
8
su -c ' pg_ctl start -D /var/lib/pgsql/data' postgres
8
9
9
10
# upgrade CoG
@@ -18,6 +19,9 @@ sed -i 's/ALLOWED_HOSTS = .*/ALLOWED_HOSTS = '"${DOCKER_IP}"'/g' $COG_CONFIG_DIR
18
19
# PRODUCTION_SERVER = True would require use of SSL to transmit any cookie
19
20
sed -i ' s/PRODUCTION_SERVER = True/PRODUCTION_SERVER = False/g' $COG_CONFIG_DIR /cog_settings.cfg
20
21
22
+ # change ownerksip of directory
23
+ chown -R cogadmin:cogadmin $COG_DIR
24
+
21
25
# Start CoG in virtual environment
22
26
cd $COG_INSTALL_DIR
23
- python ./manage.py runserver 0.0.0.0:8000
27
+ su -c ' python ./manage.py runserver 0.0.0.0:8000' cogadmin
Original file line number Diff line number Diff line change 2
2
# All setup and configuration is executed by the docker entrypoint
3
3
# when the container starts up.
4
4
5
- FROM esgfhub/cog
5
+ FROM esgfhub/cog:v3.6.1
6
6
7
7
MAINTAINER Luca Cinquini <luca.cinquini@jpl.nasa.gov>
8
8
9
+ # default user
10
+ USER cogadmin
11
+
12
+ # default working directory
13
+ WORKDIR $COG_INSTALL_DIR
14
+
9
15
# start up django+CoG with correct host IP
10
16
COPY ./docker-entrypoint.sh /
11
17
ENTRYPOINT ["/docker-entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments