Spaces:
Running
Running
Commit
·
bce93c9
1
Parent(s):
0636932
dockerfile
Browse files- Dockerfile +3 -28
Dockerfile
CHANGED
|
@@ -1,23 +1,4 @@
|
|
| 1 |
FROM python:3.7-alpine
|
| 2 |
-
# FROM ubuntu:latest
|
| 3 |
-
|
| 4 |
-
# RUN apt-get update && \
|
| 5 |
-
# apt-get -y upgrade && \
|
| 6 |
-
# apt-get install -y \
|
| 7 |
-
# sudo
|
| 8 |
-
|
| 9 |
-
# RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3 pip vim mc wget curl
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
# RUN useradd -m -u 1000 user
|
| 13 |
-
# USER user
|
| 14 |
-
# # Set home to the user's home directory
|
| 15 |
-
# ENV HOME=/home/user \
|
| 16 |
-
# PATH=/home/user/.local/bin:$PATH
|
| 17 |
-
# WORKDIR $HOME/app
|
| 18 |
-
# COPY --chown=user . $HOME/app
|
| 19 |
-
# RUN chown user:user -R $HOME/app
|
| 20 |
-
|
| 21 |
|
| 22 |
|
| 23 |
EXPOSE 8000
|
|
@@ -26,14 +7,8 @@ WORKDIR /app
|
|
| 26 |
RUN pip3 install -r requirements.txt --no-cache-dir
|
| 27 |
|
| 28 |
|
| 29 |
-
# RUN groupadd -r user && useradd -r -g user user
|
| 30 |
-
|
| 31 |
-
|
| 32 |
# RUN rm db.sqlite3
|
| 33 |
RUN ls -lh
|
| 34 |
-
# RUN chown -R user:user /app
|
| 35 |
-
# RUN chmod 777 /app/db.sqlite3
|
| 36 |
-
# USER user
|
| 37 |
|
| 38 |
|
| 39 |
# RUN python3 manage.py makemigrations;\
|
|
@@ -45,9 +20,9 @@ RUN ls -lh
|
|
| 45 |
# Without these permissions you see the errors "unable to open database file" and
|
| 46 |
# "attempt to write to a readonly database", respectively, whenever the app attempts to
|
| 47 |
# write to the database.
|
| 48 |
-
RUN chmod g+w /app
|
| 49 |
-
RUN chmod g+w /app/db.sqlite3
|
| 50 |
-
|
| 51 |
|
| 52 |
RUN ls -lh
|
| 53 |
|
|
|
|
| 1 |
FROM python:3.7-alpine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
EXPOSE 8000
|
|
|
|
| 7 |
RUN pip3 install -r requirements.txt --no-cache-dir
|
| 8 |
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
# RUN rm db.sqlite3
|
| 11 |
RUN ls -lh
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
# RUN python3 manage.py makemigrations;\
|
|
|
|
| 20 |
# Without these permissions you see the errors "unable to open database file" and
|
| 21 |
# "attempt to write to a readonly database", respectively, whenever the app attempts to
|
| 22 |
# write to the database.
|
| 23 |
+
RUN chmod g+w /app;
|
| 24 |
+
RUN chmod g+w /app/db.sqlite3;
|
| 25 |
+
# upper commands are working !
|
| 26 |
|
| 27 |
RUN ls -lh
|
| 28 |
|