-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (43 loc) · 1.9 KB
/
Copy pathDockerfile
File metadata and controls
61 lines (43 loc) · 1.9 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
FROM node:22-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN echo "Installing corepack..."
ENV COREPACK_INTEGRITY_KEYS=0
RUN corepack enable
WORKDIR /app
FROM base AS builder
ENV NODE_ENV=production
COPY pnpm-lock.yaml /app/pnpm-lock.yaml
COPY pnpm-workspace.yaml /app/pnpm-workspace.yaml
COPY package.json /app/package.json
#Packages
COPY packages/commons/package.json /app/packages/commons/package.json
COPY plugins/wp-react-blocks-plugin/blocks/package.json /app/plugins/wp-react-blocks-plugin/blocks/package.json
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --frozen-lockfile --shamefully-hoist
WORKDIR /app
COPY . /app
# Build the plugins
RUN BLOCKS_CATEGORY=wp-react-lib-blocks BLOCKS_NS=viz \
pnpm -r --filter="@devgateway/dvz-wp-commons" --filter="dg-react-blocks" build
# Organize WordPress files to the container
COPY wp-theme wp-content/themes/dg-semantic
# Copy built plugins from workspace into wp-content so built assets are included
RUN mkdir -p wp-content/plugins \
&& cp -a plugins/. wp-content/plugins/
# Create a tarball of the wp-content directory
RUN chown -R 82:82 wp-content \
&& tar -caf /wp-content.tgz --exclude="**/node_modules" wp-content
FROM wordpress:6.9.1-fpm-alpine AS runtime
LABEL org.opencontainers.image.description="WordPress image for Data Viz"
LABEL org.opencontainers.image.authors="Development Gateway <info@developmentgateway.org>"
LABEL org.opencontainers.image.url="https://github.com/devgateway/data-viz-wordpress"
LABEL org.opencontainers.image.source="https://github.com/devgateway/data-viz-wordpress"
LABEL org.opencontainers.image.vendor="Development Gateway"
LABEL org.opencontainers.image.licenses="GPL-2.0-or-later"
COPY ./custom/custom.ini /usr/local/etc/php/conf.d/
COPY --from=builder /wp-content.tgz /tmp
COPY --chmod=755 wordpress.sh /usr/local/sbin/
EXPOSE 80 443
ENTRYPOINT ["/usr/local/sbin/wordpress.sh"]
CMD ["php-fpm"]