Skip to content

Commit

Permalink
Make docker multistage for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Apr 11, 2024
1 parent 8f2cbf3 commit 686672a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
17 changes: 13 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# limitations under the License.
#

FROM node:20-bookworm-slim
FROM node:20-bookworm-slim AS base

# Image descriptor
LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \
Expand All @@ -29,15 +29,24 @@ LABEL copyright.name="Vicente Eduardo Ferrer Garcia" \

WORKDIR /metacall

RUN apt-get update \
&& apt-get install wget ca-certificates -y --no-install-recommends \
&& wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
FROM base AS deps

COPY . .

RUN npm install \
&& npm run build

FROM base as faas

RUN apt-get update \
&& apt-get install wget ca-certificates -y --no-install-recommends \
&& wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh

COPY --from=deps /metacall/node_modules node_modules
COPY --from=deps /metacall/dist dist

EXPOSE 9000

CMD ["node", "dist/index.js"]

# TODO: testing
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ services:
build:
context: .
dockerfile: Dockerfile
target: faas
ports:
- "9000:9000"
- "9000:9000"

# TODO: testing

0 comments on commit 686672a

Please sign in to comment.