-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: Use python3.11-slim as a base image and clean up the build di…
…rectory after package installation
- Loading branch information
Showing
2 changed files
with
116 additions
and
8 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
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,18 +1,38 @@ | ||
# Dockerfile for running simeon in a container | ||
FROM python:3.8-slim | ||
# set a key-value label for the Docker image | ||
FROM python:3.11-slim | ||
# Set a key-value label for the Docker image | ||
LABEL maintainer="MIT Institutional Research" | ||
LABEL email="irx@mit.edu" | ||
COPY . /simeon | ||
# defines the working directory within the container | ||
|
||
# Create the home directory | ||
RUN mkdir /simeon | ||
|
||
# Create the simeon user and group | ||
RUN useradd -d /simeon -r -U simeon | ||
RUN chown simeon:simeon /simeon | ||
|
||
# Define the working directory within the container | ||
WORKDIR /simeon | ||
# Update the repositories used by apt | ||
|
||
# Add the requirements.txt file to start building the package | ||
ADD requirements.txt /simeon/build_dir/requiremens.txt | ||
|
||
# Update the repositories used by apt and install gpg | ||
RUN apt-get update -y | ||
# Install gpg | ||
RUN apt-get install -y gnupg2 | ||
|
||
# Install python packages needed by simeon | ||
RUN pip install -U wheel | ||
RUN pip install -U pip wheel | ||
|
||
# Install simeon with geoip support | ||
RUN pip install .[geoip] | ||
ADD . /simeon/build_dir/ | ||
|
||
# Clean up | ||
RUN pip install /simeon/build_dir[geoip] | ||
RUN rm -rf /simeon/* | ||
|
||
# Set the user to simeon | ||
USER simeon:simeon | ||
|
||
# Start a shell | ||
CMD [ "bash" ] |