-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
58 lines (43 loc) · 1.45 KB
/
Dockerfile
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
ARG NODE_VERSION=14
# always use x86 for this stage
FROM --platform=linux/amd64 node:${NODE_VERSION}-alpine as frontend-build
WORKDIR /frontend
COPY /frontend/package*.json /frontend
RUN npm set registry https://registry.npmjs.org/
RUN npm set progress false
RUN npm install --unsafe-perm=true -g @angular/cli @angular-builders/custom-webpack
RUN npm clean-install
# Copy source after install dependencies
COPY frontend /frontend
# Build the frontend
RUN npx ng build --prod
###########################
FROM placeos/crystal:latest as build
WORKDIR /app
# Install the latest version of
# - [GDB debugger](https://sourceware.org/gdb/current/onlinedocs/gdb/)
# - ping (via iputils)
RUN apk add --update --no-cache gdb
RUN mkdir -p /app/bin/drivers
COPY ./shard.yml /app/shard.yml
COPY ./shard.override.yml /app/shard.override.yml
COPY ./shard.lock /app/shard.lock
RUN shards install --production --ignore-crystal-version
COPY ./src /app/src
COPY --from=frontend-build /frontend/dist/driver-spec-runner /app/www
ENV PATH="$PATH:/app/bin"
# Build App
RUN shards build \
--error-trace \
--release \
--production \
--ignore-crystal-version \
&& \
# Remove sources
rm -r lib src
# we need to mark directories as safe on newer versions of git
RUN git config --global --add safe.directory "*"
# Run the app binding on port 8080
EXPOSE 8080
ENTRYPOINT ["/app/bin/test-harness"]
CMD ["/app/bin/test-harness", "-b", "0.0.0.0", "-p", "8080"]