-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (24 loc) · 855 Bytes
/
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
# using --platform=linux/amd64 ghcr.io/gleam-lang/gleam:v1.4.0-erlang for building this locally
# FROM --platform=linux/amd64 ghcr.io/gleam-lang/gleam:v1.4.0-erlang
# Use this when deploying on fly.op
FROM ghcr.io/gleam-lang/gleam:v1.4.0-erlang
ENV ENVIRONMENT="production"
# Add project code
COPY .. /build/
# first build client and move the priv/static contents (client.mjs, client.css)
# into `/server/priv/static`
RUN rm -rf /build/client/build \
&& cd /build/client \
&& gleam run -m lustre/dev build app \
&& mv priv/static/* ../server/priv/static/
WORKDIR /build
# cd into server and then build it, moving the contents into /app dir
RUN cd /build/server \
&& gleam export erlang-shipment \
&& mv build/erlang-shipment /app \
&& rm -r /build
# Run the server
EXPOSE 8080
WORKDIR /app
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["run"]