Skip to content

Commit 19f2311

Browse files
committed
Bunch of changes to get the API running in a container, made by AI and never quite worked
1 parent e0bc793 commit 19f2311

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,4 @@ celery-worker-*.tmp
308308
local*.sh
309309
local*.py
310310
setup/
311+
/.claude

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,15 @@ RUN python manage.py collectstatic --noinput
4747

4848
USER ocl
4949

50-
RUN chmod +x set_build_version.sh wait_for_it.sh startup.sh start_celery_worker.sh ping_celery_worker.sh start_flower.sh
50+
# Normalize Windows CRLF -> LF for shell scripts checked out on Windows
51+
RUN sed -i 's/\x0D$//' set_build_version.sh startup.sh wait_for_it.sh pre_startup.sh start_celery_worker.sh ping_celery_worker.sh start_flower.sh start_celery_beat.sh
52+
53+
RUN chmod +x set_build_version.sh wait_for_it.sh startup.sh start_celery_worker.sh ping_celery_worker.sh start_flower.sh start_celery_beat.sh
5154

5255
ARG SOURCE_COMMIT
5356

54-
RUN ["bash", "-c", "./set_build_version.sh"]
57+
RUN ["bash", "set_build_version.sh"]
5558

5659
EXPOSE 8000
5760

58-
CMD ["bash", "-c", "./startup.sh"]
61+
CMD ["bash", "startup.sh"]

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ services:
2323
environment:
2424
- ENVIRONMENT=development
2525
- DEBUG=${DEBUG-TRUE}
26+
command: bash entrypoint_fix_crlf.sh
2627
celery:
2728
build: .
2829
volumes:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
volumes:
1111
- postgres-data:/var/lib/postgresql/data
1212
redis:
13-
image: bitnami/redis:7.0.12
13+
image: bitnami/redis:latest
1414
restart: "always"
1515
environment:
1616
- ALLOW_EMPTY_PASSWORD=yes

entrypoint_fix_crlf.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# Fix CRLF line endings in shell scripts from Windows bind mounts
3+
for f in /code/*.sh; do
4+
tr -d '\r' < "$f" > "$f.tmp" && mv "$f.tmp" "$f"
5+
done
6+
exec bash startup.sh

start_celery_worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ CELERY_WORKER_NAME_WITH_UUID="${CELERY_WORKER_NAME}-${UUID}"
2323

2424
echo "$CELERY_WORKER_NAME_WITH_UUID" > "/temp/celery-worker-$CELERY_WORKER_NAME.tmp"
2525

26-
celery -A core worker -n $CELERY_WORKER_NAME_WITH_UUID --loglevel=INFO "$@" -E
26+
celery -A core worker -n $CELERY_WORKER_NAME_WITH_UUID --loglevel=INFO "$@" -E

0 commit comments

Comments
 (0)