File tree 3 files changed +19
-8
lines changed
3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 3
3
/.git /
4
4
__pycache__ /
5
5
6
- /data /
6
+ /data /pgdata
7
7
/scripts /
8
8
/static /
9
9
10
10
/.dockerignore
11
11
/.gitignore
12
12
/docker-compose.yml
13
13
/Dockerfile
14
- /Pipfile.lock
14
+ /Pipfile
15
15
/Procfile
16
16
/Makefile
Original file line number Diff line number Diff line change @@ -5,12 +5,23 @@ ENV DEBUG False
5
5
6
6
WORKDIR /app/
7
7
8
- COPY Pipfile /app/Pipfile
9
- RUN pip install --upgrade pipenv && pipenv install
8
+ # Install dependencies
9
+ COPY Pipfile.lock ./
10
+ RUN pip install --upgrade pipenv \
11
+ && pipenv requirements > requirements.txt \
12
+ && pip install -r requirements.txt \
13
+ && pip uninstall -y pipenv \
14
+ && rm Pipfile.lock requirements.txt \
15
+ && mkdir data
10
16
17
+ # Copy source files
11
18
COPY . /app/
12
- RUN pipenv run ./manage.py collectstatic
19
+ RUN ./manage.py collectstatic
20
+
21
+ # Add user
22
+ RUN useradd user
23
+ USER user
13
24
14
25
EXPOSE 8000
15
- ENTRYPOINT pipenv run ./manage.py migrate \
16
- && pipenv run gunicorn app.wsgi:application --bind 0.0.0.0:8000 --workers 1
26
+ ENTRYPOINT ./manage.py migrate \
27
+ && gunicorn app.wsgi:application --bind 0.0.0.0:8000 --workers 1
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ dumpdata:
21
21
loaddata :
22
22
@echo " === Restoring $( PROD_DB_URL) ==="
23
23
@pipenv run ./manage.py flush
24
- @pipenv run ./manage.py loaddata $(BACKUP_JSON_FILE )
24
+ @pipenv run ./manage.py loaddata $(BACKUP_JSON_FILE ) -e contenttypes.contenttype -e auth.permission -e admin
25
25
26
26
# # pg_dump
27
27
You can’t perform that action at this time.
0 commit comments