-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dockerfile to support newer Ubuntu distribution requirement to…
… install python in a virtual environment (#953)
- Loading branch information
1 parent
69b51e7
commit 8d97e75
Showing
1 changed file
with
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
|
||
FROM ubuntu:latest | ||
|
||
ARG user=py4web | ||
|
||
RUN apt update && \ | ||
apt install -y git python3 python3-pip memcached && \ | ||
apt install -y git python3 python3-pip python3-venv memcached && \ | ||
service memcached restart && \ | ||
groupadd -r $user && \ | ||
useradd -m -r -g $user $user && \ | ||
python3 -m pip install -U py4web | ||
useradd -m -r -g $user $user | ||
|
||
USER $user | ||
WORKDIR /home/$user/ | ||
|
||
RUN cd /home/$user/ && py4web setup --yes apps | ||
RUN python3 -m venv venv && \ | ||
. venv/bin/activate && \ | ||
pip install -U py4web && \ | ||
py4web setup --yes apps | ||
|
||
EXPOSE 8000 | ||
|
||
WORKDIR /home/$user/ | ||
|
||
CMD py4web run --password_file password.txt --host 0.0.0.0 --port 8000 apps | ||
CMD . venv/bin/activate && py4web run --password_file password.txt --host 0.0.0.0 --port 8000 apps |