Skip to content
Snippets Groups Projects
Verified Commit bdcb1036 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Run `collectstatic` at build time

Advances #403
parent ce183405
No related branches found
No related tags found
1 merge request!544Resolve "[Docker] Do not run as root"
......@@ -61,7 +61,9 @@ CMD ["/usr/local/bin/aleksis-docker-startup"]
# Install assets
FROM core as assets
RUN eatmydata aleksis-admin yarn install
RUN eatmydata aleksis-admin yarn install; \
eatmydata aleksis-admin collectstatic; \
rm -rf /usr/local/share/.cache
# Clean up build dependencies
FROM assets AS clean
......
......@@ -46,12 +46,6 @@ wait_database() {
echo
}
prepare_static() {
# Prepare static files; should only be run in app container or job
aleksis-admin compilescss
aleksis-admin collectstatic --no-input --clear
}
prepare_database() {
# Migrate database; should only be run in app container or job
aleksis-admin migrate
......@@ -79,7 +73,6 @@ uwsgi)
if [ $PREPARE = 1 ]; then
# Responsible for running migratiosn and preparing staticfiles
prepare_database
prepare_static
else
# Wait for migrations to be applied elsewhere
wait_migrations
......@@ -103,7 +96,6 @@ celery-*)
prepare)
# Preparation only mode
prepare_database
prepare_static
;;
*)
# Run arguments as command verbatim
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment