generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.initdb
50 lines (38 loc) · 1.51 KB
/
Dockerfile.initdb
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
FROM ubuntu:24.04 AS builder
RUN apt-get update
RUN apt-get install -y curl git zip
# Copy Hermit bin stubs and install all packages. This is done
# separately so that Docker will cache the tools correctly.
COPY ./bin /src/bin
ENV PATH="/src/bin:$PATH"
WORKDIR /src
# Seed some of the most common tools - this will be cached
RUN go version
RUN node --version
# Download Go dependencies separately so Docker will cache them
COPY go.mod go.sum ./
RUN go mod download -x
# Download PNPM dependencies separately so Docker will cache them
COPY frontend/console/package.json ./frontend/console/
COPY frontend/vscode/package.json ./frontend/vscode/
COPY pnpm-workspace.yaml pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Build
COPY . /src/
RUN just errtrace
# Reset timestamps so that the build state is reset
RUN git ls-files -z | xargs -0 touch -r go.mod
RUN just build ftl-controller
# Finally create the runtime image.
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /service/
COPY --from=builder /src/build/release/ftl-controller .
COPY --from=builder /src/build/release/ftl-initdb . #TODO: Remove this line, we need a different migration image, this will get us moving for now though
EXPOSE 8891
EXPOSE 8892
ENV FTL_CONTROLLER_BIND="http://0.0.0.0:8892"
ENV FTL_CONTROLLER_ADVERTISE="http://127.0.0.1:8892"
ENV FTL_CONTROLLER_CONSOLE_URL="*"
ENV FTL_CONTROLLER_DSN="postgres://host.docker.internal/ftl?sslmode=disable&user=postgres&password=secret"
CMD ["/service/ftl-controller"]