Skip to content

Commit

Permalink
A better attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
silviogutierrez committed May 3, 2024
1 parent 8ffaeac commit e821f6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ COPY --from=builder /app/collected collected
ENV PYTHONUNBUFFERED 1
ENV PATH="/app/.venv/bin:$PATH"
ENV ENVIRONMENT=production
RUN rm server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
RUN rm -f server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
ENTRYPOINT ["/bin/sh", "-lc"]
# SSH commands are weird with fly for now, so we use this dirty script at the root level.
RUN echo "source /etc/profile; cd /app; python manage.py migrate" > /migrate.sh && chmod +x /migrate.sh
Expand Down
1 change: 0 additions & 1 deletion packages/create-django-app/scripts/sync-development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ cp ../../requirements.nix template
sed -i s#../requirements#./requirements# template/shell.nix
sed -i s#../node_modules#./node_modules# template/.eslintrc.json
rm template/server/settings/__init__.py
ln -s localhost.py template/server/settings/__init__.py
rm template/package.json
cp template/.gitignore template/gitignore.template
7 changes: 7 additions & 0 deletions packages/reactivated/scripts/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ export PGDATABASE="database"
export PGHOST=$TMP_ENV
EXTERNAL_PID="$TMP_ENV/postmaster.pid"

settings_file="server/settings/__init__.py"

# Temporary fix with Nix issues.
if [ ! -f "$settings_file" ]; then
ln -s localhost.py "$settings_file"
fi

if [ ! -d "$VIRTUAL_ENV" ]; then
if [ -f "$EXTERNAL_PID" ]; then
kill -9 "$(cat "$EXTERNAL_PID")"
Expand Down
2 changes: 1 addition & 1 deletion website/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ COPY --from=builder /app/collected collected
ENV PYTHONUNBUFFERED 1
ENV PATH="/app/.venv/bin:$PATH"
ENV ENVIRONMENT=production
RUN rm server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
RUN rm -f server/settings/__init__.py && echo 'export DJANGO_SETTINGS_MODULE=server.settings.$ENVIRONMENT' > /etc/profile
ENTRYPOINT ["/bin/sh", "-lc"]
# SSH commands are weird with fly for now, so we use this dirty script at the root level.
RUN echo "source /etc/profile; cd /app; python manage.py migrate" > /migrate.sh && chmod +x /migrate.sh
Expand Down

0 comments on commit e821f6f

Please sign in to comment.