-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
49 lines (36 loc) · 1.21 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
FROM erlang:28.0.1-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
git ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Install rebar3
RUN curl -fsSL https://github.com/erlang/rebar3/releases/download/3.27.0/rebar3 -o /usr/local/bin/rebar3 && \
chmod +x /usr/local/bin/rebar3
# Copy dependency specs first for layer caching
COPY rebar.config rebar.lock ./
RUN rebar3 compile --deps_only
# Copy source and build release
COPY config/ config/
COPY src/ src/
RUN rebar3 as prod release
# --- Runtime ---
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
libncurses6 libssl3 libtinfo6 ca-certificates tini && \
rm -rf /var/lib/apt/lists/*
RUN groupadd -r asobi && useradd -r -g asobi -d /app asobi
WORKDIR /app
COPY --from=builder /build/_build/prod/rel/asobi_lua/ ./
# Game scripts mount point
RUN mkdir -p /app/game && chown -R asobi:asobi /app
VOLUME ["/app/game"]
USER asobi
EXPOSE 8080
ENV ASOBI_PORT=8080 \
ASOBI_NODE_HOST=127.0.0.1 \
ASOBI_DB_HOST=db \
ASOBI_DB_NAME=asobi \
ASOBI_DB_USER=postgres \
ASOBI_DB_PASSWORD=postgres
ENTRYPOINT ["tini", "--"]
CMD ["bin/asobi_lua", "foreground"]