-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from candirugame/ci-docker-cache-deps
Ci docker cache deps
- Loading branch information
Showing
13 changed files
with
62 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
FROM denoland/deno:2.1.2 | ||
LABEL authors="Candiru <[email protected]>" | ||
# Build stage | ||
FROM denoland/deno:2.1.2 AS builder | ||
WORKDIR /app | ||
|
||
# Copy all source files | ||
COPY . . | ||
|
||
# Cache dependencies | ||
RUN deno cache --import-map=import_map.json main.ts | ||
|
||
# Build the application | ||
RUN deno task build | ||
|
||
# Set working directory | ||
# Runtime stage | ||
FROM denoland/deno:2.1.2 | ||
WORKDIR /app | ||
|
||
# Install curl | ||
# Install curl for runtime | ||
USER root | ||
RUN apt-get update && apt-get install -y curl | ||
|
||
# Copy the project files | ||
COPY . . | ||
# Copy ALL source files and build artifacts | ||
COPY --from=builder /app/ ./ | ||
|
||
# Copy the Deno cache | ||
COPY --from=builder /deno-dir/ /deno-dir/ | ||
|
||
# Ensure the deno user has ownership of the necessary files and directories | ||
# Set permissions | ||
RUN chown -R deno:deno /app | ||
|
||
# Switch back to deno user | ||
USER deno | ||
|
||
# Expose the port | ||
EXPOSE 3000 | ||
|
||
# Run the task | ||
CMD ["task", "start"] | ||
CMD ["task", "startnobuild"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters