Skip to content

Commit

Permalink
Merge pull request #188 from candirugame/dev
Browse files Browse the repository at this point in the history
Release v1.8.0 - dev to main
  • Loading branch information
IsaacThoman authored Dec 2, 2024
2 parents 44ba9b1 + cb90292 commit 1fd70a0
Show file tree
Hide file tree
Showing 31 changed files with 1,513 additions and 713 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,33 @@ jobs:
exit 1
fi
done
# Add this job after the build job
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build Docker image
run: docker build -t candiru .

- name: Run Docker container
run: docker run -d -p 3000:3000 candiru

- name: Health check
run: |
retries=10
count=0
until curl -f http://localhost:3000; do
count=$((count + 1))
if [ $count -lt $retries ]; then
echo "Health check failed, retrying in 5 seconds... ($count/$retries)"
sleep 5
else
echo "Health check failed after $retries attempts, exiting."
exit 1
fi
done
# Audit Job
audit:
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ WORKDIR /app

# Install curl
USER root
RUN apt-get update && apt-get install -y curl # or wget, depending on what you want
RUN apt-get update && apt-get install -y curl

# Change ownership of /app to the deno user
# Copy the project files
COPY . .

# Ensure the deno user has ownership of the necessary files and directories
RUN chown -R deno:deno /app

# Switch back to deno user
USER deno

# Copy the project files
COPY . .

# Expose the port
EXPOSE 3000

# Run the task
CMD ["task", "start"]
CMD ["task", "start"]
6 changes: 4 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"build": "deno run -A --node-modules-dir npm:vite build",
"preview": "deno run -A --node-modules-dir npm:vite preview",
"serve": "deno run --allow-net --allow-read jsr:@std/http@1/file-server dist/",
"start": "deno task build && deno run --allow-read --allow-env --allow-net main.ts"
"start": "deno task build && deno run --allow-read --allow-env --allow-net --allow-write main.ts"
},
"compilerOptions": {
"lib": ["ES2020", "DOM", "DOM.Iterable"]
"lib": ["ES2020", "DOM", "DOM.Iterable", "deno.ns"]
},
"imports": {
"@deno/vite-plugin": "npm:@deno/vite-plugin@^1.0.0",
"@oak/oak": "jsr:@oak/oak@^17.1.3",
"@std/http": "jsr:@std/http@^1.0.10",
"vite": "npm:vite@^5.4.8"
},
"lint": {
Expand Down
Loading

0 comments on commit 1fd70a0

Please sign in to comment.