Pull errors out into the main system for easy tailing
This commit is contained in:
parent
6df73ca465
commit
17679c609e
3 changed files with 12 additions and 7 deletions
8
.github/workflows/build-and-deploy.yml
vendored
8
.github/workflows/build-and-deploy.yml
vendored
|
|
@ -39,8 +39,8 @@ jobs:
|
||||||
context: ./web-app
|
context: ./web-app
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/web-app:${{ github.sha }}
|
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/web-app:${{ github.sha }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha,scope=web-app
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max,scope=web-app
|
||||||
|
|
||||||
- name: Build and push Rust engine image ⚙️
|
- name: Build and push Rust engine image ⚙️
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
|
|
@ -48,8 +48,8 @@ jobs:
|
||||||
context: ./rust-engine
|
context: ./rust-engine
|
||||||
push: true
|
push: true
|
||||||
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/rust-engine:${{ github.sha }}
|
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/rust-engine:${{ github.sha }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha,scope=rust-engine
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max,scope=rust-engine
|
||||||
|
|
||||||
- name: Ensure remote deploy directory exists
|
- name: Ensure remote deploy directory exists
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ services:
|
||||||
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/${MYSQL_DATABASE}
|
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/${MYSQL_DATABASE}
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
volumes:
|
||||||
|
- ~/astra-errors.log:/var/log/astra-errors.log
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
|
|
|
||||||
|
|
@ -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 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
|
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
|
EXPOSE 8000
|
||||||
USER appuser
|
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"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue