Skip to content

Commit

Permalink
collect static files at build image
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <aizquier@redhat.com>
  • Loading branch information
Alex-Izquierdo committed Jun 20, 2024
1 parent 7e2fea6 commit 43d598d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM quay.io/centos/centos:stream9

ARG USER_ID=${USER_ID:-1001}
ARG STATIC_ROOT=/var/lib/eda/static
RUN useradd --uid "$USER_ID" --gid 0 --home-dir /app --create-home eda \
&& mkdir -p /app/.local /var/lib/eda/ \
&& chown -R "${USER_ID}:0" /app/.local /var/lib/eda \
Expand Down Expand Up @@ -52,6 +53,7 @@ RUN poetry install -E all --no-root --no-cache \
COPY . $SOURCES_DIR/
RUN poetry install -E all --only-root
RUN pip install ansible-core
RUN EDA_SECRET_KEY=dummy EDA_STATIC_ROOT=${STATIC_ROOT} aap-eda-manage collectstatic --noinput --clear

USER 0
RUN for dir in \
Expand Down
3 changes: 1 addition & 2 deletions tools/docker/docker-compose-dev-redis-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ services:
- /bin/bash
- -c
- >-
aap-eda-manage collectstatic --noinput
&& aap-eda-manage migrate
aap-eda-manage migrate
&& aap-eda-manage create_initial_data
&& scripts/create_superuser.sh
&& aap-eda-manage runserver 0.0.0.0:8000
Expand Down
3 changes: 1 addition & 2 deletions tools/docker/docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ services:
- /bin/bash
- -c
- >-
aap-eda-manage collectstatic --noinput
&& aap-eda-manage migrate
aap-eda-manage migrate
&& aap-eda-manage create_initial_data
&& scripts/create_superuser.sh
&& aap-eda-manage runserver 0.0.0.0:8000
Expand Down
3 changes: 1 addition & 2 deletions tools/docker/docker-compose-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ services:
- /bin/bash
- -c
- >-
aap-eda-manage collectstatic --noinput
&& aap-eda-manage migrate
aap-eda-manage migrate
&& aap-eda-manage create_initial_data
&& scripts/create_superuser.sh
&& aap-eda-manage runserver 0.0.0.0:8000
Expand Down
3 changes: 1 addition & 2 deletions tools/docker/docker-compose-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ services:
- /bin/bash
- -c
- >-
aap-eda-manage collectstatic --noinput
&& aap-eda-manage migrate
aap-eda-manage migrate
&& aap-eda-manage create_initial_data
&& scripts/create_superuser.sh
&& gunicorn -b 0.0.0.0:8000
Expand Down

0 comments on commit 43d598d

Please sign in to comment.