FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
anycode/anycode.dockerfile at main · anycode-ade/anycode · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
anycode-ade
/
anycode
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
44
Code
Issues
13
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
anycode
/
anycode.dockerfile
Copy path
More file actions
More file actions
Latest commit
History
History
History
77 lines (62 loc) · 2.25 KB
Breadcrumbs
anycode
/
anycode.dockerfile
Copy path
File metadata and controls
77 lines (62 loc) · 2.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
Stage 1: Build React app
FROM
node:alpine AS anycode-frontend-builder
WORKDIR
/app
#
Install pnpm
RUN
npm install -g pnpm
#
Copy workspace files
COPY
package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json ./
COPY
anycode/package.json ./anycode/
COPY
anycode-base/package.json ./anycode-base/
COPY
anycode-react/package.json ./anycode-react/
#
Install dependencies
RUN
pnpm install --frozen-lockfile
#
Copy source code
COPY
anycode ./anycode/
COPY
anycode-base ./anycode-base/
COPY
anycode-react ./anycode-react/
#
Build frontend
WORKDIR
/app/anycode
RUN
pnpm run build
#
Stage 1b: Copy anycode-base langs
FROM
node:alpine AS anycode-base-builder
WORKDIR
/app/base
COPY
anycode-base/src/langs ./langs
#
Stage 2a: Preparation for building Rust backend (base image with cargo-chef)
FROM
rust:alpine AS chef
RUN
apk add --no-cache libc-dev openssl-dev perl make cmake
RUN
cargo install cargo-chef
WORKDIR
/app/backend
#
Stage 2b: Planning (dependency calculation)
FROM
chef AS planner
COPY
anycode-backend ./
RUN
cargo chef prepare --recipe-path recipe.json
#
Stage 2c: Building backend using dependency caching
FROM
chef AS anycode-backend-builder
COPY
--from=planner /app/backend/recipe.json recipe.json
RUN
cargo chef cook --release --recipe-path recipe.json
COPY
anycode-backend ./
COPY
--from=anycode-frontend-builder /app/anycode/dist ./dist
RUN
cargo build --release
#
Stage 3: Final image
FROM
debian:bookworm-slim
RUN
apt-get update && apt-get install -y bash curl git procps
#
FROM alpine
#
RUN apk add --no-cache openssl bash curl git
WORKDIR
/app/backend
#
Copying the built frontend and backend artifacts
COPY
--from=anycode-frontend-builder /app/anycode/dist /app/dist
COPY
--from=anycode-backend-builder /app/backend/target/release/anycode ./
COPY
--from=anycode-backend-builder /app/backend/config.toml ./
COPY
--from=anycode-base-builder /app/base/langs /app/src/backend/langs
ENV
ANYCODE_HOME=/app
ENV
ANYCODE_CONFIG=/app/backend/config.toml
ENV
ANYCODE_DIST=/app/dist
ARG
ANYCODE_PORT=3000
ENV
ANYCODE_PORT=$ANYCODE_PORT
#
Expose the port
EXPOSE
$ANYCODE_PORT
WORKDIR
/develop
CMD
[
"/app/backend/anycode"
]
#
docker build -f anycode.dockerfile -t anycode .
#
docker run -it --rm -p 3000:3000 anycode
#
docker run -it --rm -p 3000:3000 -v "$(pwd)":/develop anycode
Back
|
FazBrowse Home
|
New Git URL