Skip to content

Commit

Permalink
Update Dockerfile (linkedin#373)
Browse files Browse the repository at this point in the history
* Update Dockerfile

- update to Ubuntu 20.04
- run package installation noninteractive
- before installing any other pip dependencies, install wheel first
  to remove any waring about messages about missing wheel

* Update Dockerfile

- include LICENSE in the container image
- remove unneeded copy of all files e.g. git directory
  • Loading branch information
roock authored Apr 25, 2022
1 parent 262af21 commit f48a7f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

RUN apt-get update && apt-get -y dist-upgrade \
&& apt-get -y install libffi-dev libsasl2-dev python3-dev \
RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::=--force-confold dist-upgrade \
&& DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::=--force-confold install libffi-dev libsasl2-dev python3-dev \
sudo libldap2-dev libssl-dev python3-pip python3-setuptools python3-venv \
mysql-client uwsgi uwsgi-plugin-python3 nginx \
&& rm -rf /var/cache/apt/archives/*
Expand All @@ -12,15 +12,15 @@ COPY src /home/oncall/source/src
COPY setup.py /home/oncall/source/setup.py
COPY MANIFEST.in /home/oncall/source/MANIFEST.in
COPY README.md /home/oncall/source/README.md
COPY LICENSE /home/oncall/source/LICENSE

WORKDIR /home/oncall

RUN chown -R oncall:oncall /home/oncall/source /var/log/nginx /var/lib/nginx \
&& sudo -Hu oncall mkdir -p /home/oncall/var/log/uwsgi /home/oncall/var/log/nginx /home/oncall/var/run /home/oncall/var/relay \
&& sudo -Hu oncall python3 -m venv /home/oncall/env \
&& sudo -Hu oncall /bin/bash -c 'source /home/oncall/env/bin/activate && cd /home/oncall/source && pip install .'
&& sudo -Hu oncall /bin/bash -c 'source /home/oncall/env/bin/activate && cd /home/oncall/source && pip install wheel && pip install .'

COPY . /home/oncall
COPY ops/config/systemd /etc/systemd/system
COPY ops/daemons /home/oncall/daemons
COPY ops/daemons/uwsgi-docker.yaml /home/oncall/daemons/uwsgi.yaml
Expand Down

0 comments on commit f48a7f3

Please sign in to comment.