-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (44 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (44 loc) · 1.62 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
53
54
55
56
57
58
FROM node:22-bookworm-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
RUN npm prune --omit=dev
FROM node:22-bookworm-slim AS runtime
ARG AEROPLANE_COMMIT_SHA=unknown
ARG AEROPLANE_IMAGE_SOURCE=https://github.com/xt42io/aeroplane
LABEL org.opencontainers.image.source=$AEROPLANE_IMAGE_SOURCE
LABEL org.opencontainers.image.revision=$AEROPLANE_COMMIT_SHA
ENV NODE_ENV=production \
PORT=4310 \
HOST=0.0.0.0 \
DATA_DIR=/data \
AEROPLANE_COMMIT_SHA=$AEROPLANE_COMMIT_SHA
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
openssl \
openssh-client \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
&& chmod a+r /etc/apt/keyrings/docker.asc \
&& . /etc/os-release \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
docker-ce-cli \
docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://railpack.com/install.sh | sh -s -- --bin-dir /usr/local/bin
WORKDIR /app
COPY --from=builder /app/package.json /app/package-lock.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/src/server/assets ./src/server/assets
RUN mkdir -p /data
VOLUME ["/data"]
EXPOSE 4310
CMD ["node", "dist/server/index.js"]