Holger Frey 4 years ago
parent
commit
719b00c710
  1. 35
      Dockerfile
  2. 30
      Dockerfile alpine
  3. 2
      README.md

35
Dockerfile

@ -1,15 +1,24 @@
FROM python:3.8-alpine FROM ubuntu:latest
# install required packages # update to the latest packages
RUN apk add --no-cache gcc ENV DEBIAN_FRONTEND="noninteractive"
RUN apk add --no-cache python3-dev RUN apt-get update && apt-get upgrade -y
RUN apk add --no-cache libc-dev
RUN apk add --no-cache libffi-dev
RUN apk add --no-cache openssl
RUN apk add --no-cache openssl-dev
# add user that will be used to install and run the application # add user that will be used to install and run the application
RUN adduser -D deploy RUN groupadd -g 1000 deploy
RUN useradd -m -u 1000 -g deploy deploy
# install required packages for debugging
# RUN apt-get install -y vim curl lsof
#
# CUSTOM PART IS BELOW HERE
#
# install required packages
RUN apt-get install -y python3 python3-pip
# switch to the created user and install the application # switch to the created user and install the application
USER deploy USER deploy
@ -26,11 +35,9 @@ RUN pip install -r requirements.txt
RUN flit install --pth-file RUN flit install --pth-file
# switch back to root to remove header files # switch back to root to remove header files
USER root #USER root
RUN apk delete python3-dev #RUN apk del libc-dev libffi-dev openssl-dev python3-dev
RUN apk delete libffi-dev
RUN apk delete openssl-dev
# switch to the created user to run the application # switch to the created user to run the application
USER deploy #USER deploy
CMD ["gunicorn", "--paster", "/app/production.ini", "-b", "0.0.0.0:8000"] CMD ["gunicorn", "--paster", "/app/production.ini", "-b", "0.0.0.0:8000"]

30
Dockerfile alpine

@ -0,0 +1,30 @@
FROM python:3.8-alpine
# install required packages
RUN apk add --no-cache gcc libc-dev libffi-dev openssl openssl-dev python3-dev
# add user that will be used to install and run the application
RUN addgroup -g 1000 deploy
RUN adduser -D -u 1000 -G deploy deploy
# switch to the created user and install the application
USER deploy
ENV PATH "$PATH:/home/deploy/.local/bin"
COPY . /app
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install gunicorn
RUN pip install wheel
RUN pip install -r requirements.txt
RUN flit install --pth-file
# switch back to root to remove header files
USER root
RUN apk del libc-dev libffi-dev openssl-dev python3-dev
# switch to the created user to run the application
USER deploy
CMD ["gunicorn", "--paster", "/app/production.ini", "-b", "0.0.0.0:8000"]

2
README.md

@ -13,7 +13,7 @@ Decisions and goals in this project:
- have automatic unit test and functional tests, the coverage should be above 90% - have automatic unit test and functional tests, the coverage should be above 90%
- complete data migration from the old system - complete data migration from the old system
The new system is now online at https://ordr.cpi.imtek.uni-freiburg.de since late April 2020 The new system is now online at https://ordr.cpi.imtek.uni-freiburg.de since late April 2020.
## Development ## Development

Loading…
Cancel
Save