@@ -70,21 +70,18 @@ RUN if [ -d /app/packages/twenty-front/build ]; then \
7070
7171
7272# ===========================================================================
73- # Target: twenty (production )
74- # docker build --target twenty -f packages/twenty-docker/twenty/Dockerfile .
73+ # Target: twenty-server (server only, no frontend )
74+ # docker build --target twenty-server -f packages/twenty-docker/twenty/Dockerfile .
7575# ===========================================================================
7676
77- FROM node:24-alpine AS twenty
77+ FROM node:24-alpine AS twenty-server
7878
7979RUN apk add --no-cache curl jq postgresql-client
8080
8181COPY ./packages/twenty-docker/twenty/entrypoint.sh /app/entrypoint.sh
8282RUN chmod +x /app/entrypoint.sh
8383WORKDIR /app/packages/twenty-server
8484
85- ARG REACT_APP_SERVER_BASE_URL
86- ENV REACT_APP_SERVER_BASE_URL=$REACT_APP_SERVER_BASE_URL
87-
8885ARG APP_VERSION
8986ENV APP_VERSION=$APP_VERSION
9087
@@ -110,11 +107,8 @@ COPY --chown=1000 --from=twenty-server-build /app/packages/twenty-client-sdk/dis
110107COPY --chown=1000 --from=twenty-server-build /app/packages/twenty-ui/package.json /app/packages/twenty-ui/
111108COPY --chown=1000 --from=twenty-server-build /app/packages/twenty-front/package.json /app/packages/twenty-front/
112109
113- # Frontend static build
114- COPY --chown=1000 --from=twenty-front-build /app/packages/twenty-front/build /app/packages/twenty-server/dist/front
115-
116110LABEL org.opencontainers.image.source=https://github.com/twentyhq/twenty
117- LABEL org.opencontainers.image.description="Production Twenty image with backend and frontend."
111+ LABEL org.opencontainers.image.description="Twenty server image (no frontend) ."
118112
119113RUN mkdir -p /app/.local-storage /app/packages/twenty-server/.local-storage && \
120114 chown 1000:1000 /app/.local-storage /app/packages/twenty-server/.local-storage
@@ -126,8 +120,35 @@ ENTRYPOINT ["/app/entrypoint.sh"]
126120
127121
128122# ===========================================================================
129- # Target: twenty-aws
130- # docker build --target twenty-aws -f packages/twenty-docker/twenty/Dockerfile .
123+ # Target: twenty-server-aws (server only + aws-cli, no frontend)
124+ # docker build --target twenty-server-aws -f packages/twenty-docker/twenty/Dockerfile .
125+ # ===========================================================================
126+
127+ FROM twenty-server AS twenty-server-aws
128+
129+ USER root
130+ RUN apk add --no-cache aws-cli
131+ USER 1000
132+
133+
134+ # ===========================================================================
135+ # Target: twenty (server + frontend)
136+ # docker build --target twenty -f packages/twenty-docker/twenty/Dockerfile .
137+ # ===========================================================================
138+
139+ FROM twenty-server AS twenty
140+
141+ ARG REACT_APP_SERVER_BASE_URL
142+ ENV REACT_APP_SERVER_BASE_URL=$REACT_APP_SERVER_BASE_URL
143+
144+ COPY --chown=1000 --from=twenty-front-build /app/packages/twenty-front/build /app/packages/twenty-server/dist/front
145+
146+ LABEL org.opencontainers.image.description="Twenty image with backend and frontend."
147+
148+
149+ # ===========================================================================
150+ # Target: twenty-aws (server + frontend + aws-cli)
151+ # docker build --target twenty-aws -f packages/twenty-docker/twenty/Dockerfile .
131152# ===========================================================================
132153
133154FROM twenty AS twenty-aws
0 commit comments