This repository has been archived by the owner on Jan 25, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
77 lines (65 loc) · 1.81 KB
/
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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Phase one: build
FROM node:18-bullseye-slim as builder
# Create app directory
WORKDIR /FriendConnect
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
jq \
file \
unzip \
make \
gcc \
g++ \
python \
python-dev \
libtool \
cmake
# Set up FriendConnect
RUN git clone https://github.com/GraftMC/FriendConnect . \
&& mv test/index.js . \
&& rm .env \
&& rm -rf test \
&& sed -i 's|import { Session } from "../dist/index.js";|import { Session } from "friend-connect";|' index.js \
&& npm install
# Run Phase
FROM node:18-bookworm-slim
LABEL author="Loki" maintainer="[email protected]"
# Install run-time dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
iproute2 \
git \
sqlite3 \
libsqlite3-dev \
python3 \
python3-dev \
ca-certificates \
dnsutils \
tzdata \
zip \
tar \
curl \
build-essential \
libtool \
iputils-ping \
libnss3 \
tini \
&& rm -rf /var/lib/apt/lists/*
# Create a user for the application
RUN useradd -m -d /FriendConnect friendconnect && chown -R friendconnect:friendconnect /FriendConnect
# Copy FriendConnect directory from builder
COPY --from=builder /FriendConnect /FriendConnect
RUN chown -R friendconnect:friendconnect /FriendConnect
# Install global npm packages
RUN npm install [email protected] typescript ts-node @types/node --location=global
# Set user and working directory
USER friendconnect
ENV USER=friendconnect HOME=/FriendConnect
WORKDIR /FriendConnect
STOPSIGNAL SIGINT
# Set tini as entrypoint
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
# Default command
CMD ["node", "--es-module-specifier-resolution=node", "--experimental-fetch", "index.js"]