Skip to content

Commit

Permalink
format Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dkristia committed May 20, 2024
1 parent 002f875 commit 904db08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions arm.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM arm64v8/rust:1.77-slim-buster
FROM tonistiigi/binfmt:latest AS qemu

FROM --platform=linux/arm64 arm64v8/rust:1.77-slim-buster as rust

WORKDIR /app

Expand All @@ -12,11 +14,11 @@ COPY rustend/ rustend/

RUN cd rustend && wasm-pack build --target web --out-dir pkg

FROM arm64v8/node:22-alpine3.18
FROM --platform=linux/arm64 arm64v8/node:22-alpine3.18 as node

WORKDIR /app/client

COPY --from=0 /app/rustend/pkg/ ../rustend/pkg/
COPY --from=rust /app/rustend/pkg/ ../rustend/pkg/

COPY client/package.json .
COPY client/package-lock.json .
Expand All @@ -27,6 +29,6 @@ COPY client/ .

RUN npm run build:react

FROM arm64v8/nginx:latest
FROM --platform=linux/arm64 arm64v8/nginx:latest as nginx

COPY --from=1 /app/client/dist/ /usr/share/nginx/html
COPY --from=node /app/client/dist/ /usr/share/nginx/html
10 changes: 5 additions & 5 deletions x86_64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.77-slim-buster
FROM rust:1.77-slim-buster as rust

WORKDIR /app

Expand All @@ -12,11 +12,11 @@ COPY rustend/ rustend/

RUN cd rustend && wasm-pack build --target web --out-dir pkg

FROM node:22-alpine3.18
FROM node:22-alpine3.18 as node

WORKDIR /app/client

COPY --from=0 /app/rustend/pkg/ ../rustend/pkg/
COPY --from=rust /app/rustend/pkg/ ../rustend/pkg/

COPY client/package.json .
COPY client/package-lock.json .
Expand All @@ -27,6 +27,6 @@ COPY client/ .

RUN npm run build:react

FROM nginx:latest
FROM nginx:latest as nginx

COPY --from=1 /app/client/dist/ /usr/share/nginx/html
COPY --from=node /app/client/dist/ /usr/share/nginx/html

0 comments on commit 904db08

Please sign in to comment.