-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (35 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
52 lines (35 loc) · 1.06 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
45
46
47
48
49
50
51
52
ARG GLEAM_VERSION=1.14.0
# Builder stage
FROM ghcr.io/gleam-lang/gleam:v${GLEAM_VERSION}-erlang-alpine AS builder
RUN apk update && apk add --no-cache build-base python3
RUN apk add --update nodejs npm elixir git
WORKDIR /build
# copy source files
COPY package.json package-lock.json ./
# install node deps
RUN npm install
# copy source files
COPY . .
# install gleam deps
RUN gleam deps download
# build gleam app
RUN gleam build
# build tailwind styles
RUN npm run tailwind:build
# build client app
RUN npm run client:build
# # build release
RUN gleam export erlang-shipment
RUN mv build/erlang-shipment /app
# Final stage
FROM ghcr.io/gleam-lang/gleam:v${GLEAM_VERSION}-erlang-alpine
WORKDIR /app
RUN chown nobody /app
RUN apk add --no-cache curl \
&& curl -fsSL https://github.com/pressly/goose/releases/download/v3.24.3/goose_linux_x86_64 -o /usr/local/bin/goose \
&& chmod +x /usr/local/bin/goose
# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app /app
USER nobody
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["run"]