-
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathDockerfile.test
More file actions
44 lines (31 loc) · 1.24 KB
/
Dockerfile.test
File metadata and controls
44 lines (31 loc) · 1.24 KB
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
# This Dockerfile is used to run the tests in a clean environment on your own machine
# If CI is failing you can run bun run test:docker on your own machine to debug
# NB The Container will close after bun run test has run, so amend to keep it alive if you want
# to run tests inside the container
# syntax=docker/dockerfile:1.2
# Use Bun as the base image
FROM oven/bun:1.2.22
# Set the CI environment variable
ENV CI=true
# Install Node.js for npm (needed for some operations)
RUN apt-get update && apt-get install -y curl git
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y nodejs
RUN echo "node: $(node -v)"
RUN echo "bun: $(bun -v)"
# Set the working directory
WORKDIR /app
# Copy the local .git folder into the Docker image
COPY .git /app/.git
ARG CACHEBUST=1
RUN git clone --local /app/.git /app/repo
WORKDIR /app/repo
# Install root dependencies with the --frozen-lockfile flag
RUN bun install --frozen-lockfile
RUN bun run clean:build
RUN bun run build
RUN cd packages/vxrn && bun run build
# Run the tests and capture the output
CMD ["bun", "run", "test"]
# Uncomment to keep the container running after the tests have run
# CMD bun run test; echo "Tests completed. Container is still running."; tail -f /dev/null