This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfile and docker-compose.yml
* 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
Showing
2 changed files
with
7 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,4 @@ lmodproxy: | |
ports: | ||
- "8080:8080" | ||
volumes: | ||
- .:/src | ||
- /tmp | ||
- .:/opt/lmod_proxy |