Pull errors out into the main system for easy tailing

This commit is contained in:
Christbru 2025-10-18 21:21:48 -05:00
commit 17679c609e
3 changed files with 12 additions and 7 deletions

View file

@ -39,8 +39,8 @@ jobs:
context: ./web-app
push: true
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/web-app:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=web-app
cache-to: type=gha,mode=max,scope=web-app
- name: Build and push Rust engine image ⚙️
uses: docker/build-push-action@v6
@ -48,8 +48,8 @@ jobs:
context: ./rust-engine
push: true
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/rust-engine:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=rust-engine
cache-to: type=gha,mode=max,scope=rust-engine
- name: Ensure remote deploy directory exists
uses: appleboy/ssh-action@v1.0.3

View file

@ -19,6 +19,8 @@ services:
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/${MYSQL_DATABASE}
depends_on:
- mysql
volumes:
- ~/astra-errors.log:/var/log/astra-errors.log
mysql:
image: mysql:8.0

View file

@ -69,10 +69,13 @@ RUN useradd --system --uid 10001 --no-create-home --shell /usr/sbin/nologin appu
# Copy the compiled binary from the builder stage
# Copy the compiled binary and set ownership
COPY --from=builder /usr/src/app/target/release/rust-engine /usr/local/bin/rust-engine
RUN chown appuser:appuser /usr/local/bin/rust-engine
RUN chown appuser:appuser /usr/local/bin/rust-engine \
&& mkdir -p /var/log \
&& touch /var/log/astra-errors.log \
&& chown appuser:appuser /var/log/astra-errors.log
EXPOSE 8000
USER appuser
CMD ["rust-engine"]
# Redirect all output to /var/log/astra-errors.log for easy monitoring
ENTRYPOINT ["/bin/sh", "-c", "/usr/local/bin/rust-engine >> /var/log/astra-errors.log 2>&1"]