-
Notifications
You must be signed in to change notification settings - Fork 658
Expand file tree
/
Copy pathDockerfile.dev.aio
More file actions
65 lines (51 loc) · 1.65 KB
/
Dockerfile.dev.aio
File metadata and controls
65 lines (51 loc) · 1.65 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
# --- Build stage ---
FROM node:24-alpine AS builder
WORKDIR /plasmic
# Install system deps
RUN apk add --no-cache \
bash \
git \
curl \
wget \
python3 \
py3-pip \
postgresql-client \
build-base
# Copy only dependency files first for caching
COPY package.json yarn.lock ./
# Install deps early for cache
RUN yarn install --frozen-lockfile --prefer-offline
# Then copy rest of the app
COPY . .
# Secrets setup and build tools
RUN mkdir -p /tmp/.plasmic && \
cp platform/wab/tools/docker-dev/secrets.json /tmp/.plasmic/secrets.json && \
yarn setup && \
yarn setup:canvas-packages && \
yarn cache clean
# --- Final stage ---
FROM node:24-alpine
# Delete container default node user
RUN deluser --remove-home node 2>/dev/null || true && \
delgroup node 2>/dev/null || true
# Create non-root user with UID 1000 and GID 1000 and prepare env
RUN addgroup -g 1000 plasmic && \
adduser -u 1000 -G plasmic -S plasmic && \
apk add --no-cache git jq bash && \
echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf && \
sysctl -p && \
mkdir -p /home/plasmic && \
chown -R 1000:1000 /home/plasmic
USER plasmic
WORKDIR /plasmic/platform/wab
# Copy built app and secrets with correct ownership
COPY --chown=plasmic:plasmic --from=builder /plasmic /plasmic
COPY --chown=plasmic:plasmic --from=builder /tmp/.plasmic /home/plasmic/.plasmic
EXPOSE 3003 3004 3005
ENTRYPOINT ["sh", "-c"]
CMD [" jq '(.host = \"plasmic-db\") | (.password //= \"SEKRET\")' ormconfig.json > tmp.json && mv tmp.json ormconfig.json && \
yarn typeorm migration:run && \
yarn seed && \
cd /plasmic && \
yarn dev \
"]