Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
Update Dockerfile and docker-compose.yml
Browse files Browse the repository at this point in the history
* Use newer Python 3.7.5 image and remove installation commands that it
  obviates
* Update maintainer to use LABEL (modern recommendation)
* Change name of app directory to be more orthodox
* Change user name to more meaningful "lmodproxy"
  • Loading branch information
Mark Breedlove committed Nov 14, 2019
1 parent 09f1f7d commit 59c8881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
32 changes: 6 additions & 26 deletions Dockerfile
@@ -1,29 +1,9 @@
FROM ubuntu:xenial
MAINTAINER ODL DevOps <mitx-devops@mit.edu>

# Install base packages
RUN apt-get update && apt-get install -y python-pip python-dev
RUN pip install pip --upgrade

# Add non-root user.
RUN adduser --disabled-password --gecos "" mitodl

# Add project
COPY . /src
WORKDIR /src
RUN chown -R mitodl:mitodl /src
RUN touch .htpasswd && chmod 666 .htpasswd && touch .cert.pem && chmod 666 .cert.pem

# Install project packages
FROM python:3.7.5-buster
LABEL maintainer="ODL DevOps <mitx-devops@mit.edu>"
RUN adduser --disabled-password --gecos "lmod_proxy privsep user" lmodproxy
COPY . /opt/lmod_proxy
WORKDIR /opt/lmod_proxy
RUN pip install -r ./requirements.txt


# Clean up
RUN apt-get clean && apt-get purge
USER mitodl

# Set pip cache folder, as it is breaking pip when it is on a shared volume
ENV XDG_CACHE_HOME /tmp/.cache

EXPOSE 8080
USER lmodproxy
CMD uwsgi uwsgi.ini
3 changes: 1 addition & 2 deletions docker-compose.yml
Expand Up @@ -9,5 +9,4 @@ lmodproxy:
ports:
- "8080:8080"
volumes:
- .:/src
- /tmp
- .:/opt/lmod_proxy

0 comments on commit 59c8881

Please sign in to comment.