-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (41 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
52 lines (41 loc) · 1.16 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
FROM node:25.2.1-alpine AS install
WORKDIR /app
# --- build deps for node-gyp & canvas on Alpine ---
RUN apk add --no-cache \
python3 \
build-base \
pkgconfig \
cairo-dev pango-dev pixman-dev \
libjpeg-turbo-dev giflib-dev librsvg-dev
# make sure node-gyp sees python
ENV PYTHON=/usr/bin/python3
ENV PATH=/app/node_modules/.bin:$PATH
# Yarn 4 needs the .yarn dir in the image
# COPY .yarn ./.yarn
COPY .yarnrc.yml ./
COPY package.json ./
COPY yarn.lock ./
# https://yarnpkg.com/corepack
RUN corepack enable
RUN yarn install --immutable
FROM install AS development
ENV INLINE_RUNTIME_CHUNK=false
FROM install AS build
COPY src src
COPY public public
COPY config config
COPY tsconfig.json ./
COPY index.html ./
COPY vite.config.js ./
COPY LICENSE ./
# only links to public websites
COPY .env ./
COPY arasaac-pictogram-viewer.php ./
ENV INLINE_RUNTIME_CHUNK=false
ENV REACT_APP_API=/arasaac/api
ENV REACT_APP_API_IMAGES=/arasaac/images
RUN yarn build:app
FROM nginxinc/nginx-unprivileged:stable-alpine3.19-slim AS production
COPY --from=build /app/build /usr/share/nginx/html
COPY config/nginx/default.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]