1+ FROM phusion/passenger-customizable:2.0.0
2+ LABEL maintiainer="jrhoads@datacite.org"
13
2- FROM phusion/passenger-full:1.0.6
4+ # Set correct environment variables.
5+ ENV HOME /home/app
6+ ENV LC_ALL en_US.UTF-8
7+ ENV LANG en_US.UTF-8
38
49# Use baseimage-docker's init process.
510CMD ["/sbin/my_init" ]
611
7- # Update installed APT packages
8- RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
9- apt-get install -y ntp pandoc
10-
11- # Fetch PIP install script and run
12- ADD "https://bootstrap.pypa.io/get-pip.py" /tmp/get-pip.py
13- RUN python3 /tmp/get-pip.py
14-
15- # Fetch pipenv install script and run
16- ADD "https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py" /tmp/get-pipenv.py
17- RUN python3 /tmp/get-pipenv.py
12+ # Allow app user to read /etc/container_environment
13+ RUN usermod -a -G docker_env app
1814
19- # Cleanup
15+ RUN /pd_build/python.sh
16+ # Update installed APT packages
17+ RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold"
18+ RUN apt-get install -y ntp pandoc pipenv
2019RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
2120
21+
2222# Enable Passenger and Nginx and remove the default site
2323# Preserve env variables for nginx
2424RUN rm -f /etc/service/nginx/down && \
@@ -31,36 +31,36 @@ COPY vendor/docker/env.conf /etc/nginx/main.d/env.conf
3131# Use Amazon NTP servers
3232COPY vendor/docker/ntp.conf /etc/ntp.conf
3333
34+ # Run additional scripts during container startup (i.e. not at build time)
35+ RUN mkdir -p /etc/my_init.d
36+
37+ # enable SSH
38+ RUN rm -f /etc/service/sshd/down && \
39+ /etc/my_init.d/00_regen_ssh_host_keys.sh
40+
41+ # install custom ssh key during startup
42+ COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
43+
44+ # restart server on file changes in development
45+ COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh
46+
3447# # Viringo setup
3548
3649# Copy webapp folder
3750COPY . /home/app/webapp/
3851
39- # Copy tests over to app folder
40- COPY tests /home/app/tests
41-
4252# Configure permissions
4353RUN chown -R app:app /home/app/webapp && \
4454 chmod -R 755 /home/app/webapp
4555
4656# Set working directory
4757WORKDIR /home/app/webapp
4858
59+ # Update Pip and Pipenv
60+ RUN pip install -U pip pipenv
61+
4962# Install any needed packages specified in pipenv pipfile
5063RUN pipenv install --system --deploy --ignore-pipfile
5164
52- # Run additional scripts during container startup (i.e. not at build time)
53- RUN mkdir -p /etc/my_init.d
54-
55- # enable SSH
56- RUN rm -f /etc/service/sshd/down && \
57- /etc/my_init.d/00_regen_ssh_host_keys.sh
58-
59- # install custom ssh key during startup
60- COPY vendor/docker/10_ssh.sh /etc/my_init.d/10_ssh.sh
61-
62- # restart server on file changes in development
63- COPY vendor/docker/20_always_restart.sh /etc/my_init.d/20_always_restart.sh
64-
6565# Expose web
66- EXPOSE 80
66+ EXPOSE 80
0 commit comments