forked from GitSquared/edex-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (63 loc) · 1.41 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (63 loc) · 1.41 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Use Ubuntu as base image
FROM ubuntu:22.04
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_VERSION=18.x
# Add NodeSource repo and install all dependencies including nodejs
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg && \
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
python3 \
make \
g++ \
libx11-dev \
libxkbfile-dev \
libsecret-1-dev \
x11-xserver-utils \
x11-utils \
x11-apps \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libcairo2 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY src/package*.json ./src/
# Install dependencies
RUN npm install && \
cd src && \
npm install && \
cd ..
# Copy source code
COPY . .
# Set display environment variable
ENV DISPLAY=:0
# Create a non-root user
RUN useradd -m -s /bin/bash edex
RUN chown -R edex:edex /app
USER edex
# Command to run the application
CMD ["npm", "start"]