Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.20.6-bookworm as builder
FROM node:22.2.0-alpine3.19 as npm-builder

WORKDIR /work/

COPY . .
COPY ./web/boxdocker ./web/boxdocker

RUN apt update && apt install npm nodejs zip -y
RUN apk add --no-cache zip
RUN cd web/boxdocker && npm install && npm run build && mv dist boxdocker && \
zip -r static_html.zip boxdocker && mv static_html.zip ../../res && cd ../../
zip -r static_html.zip boxdocker && mkdir ../../res && mv static_html.zip ../../res

FROM golang:1.22.3-alpine3.20 as golang-builder

WORKDIR /work/

COPY . .

COPY --from=npm-builder /work/res /work/res

RUN apk add --no-cache make
RUN go env -w GO111MODULE=on && make -f Makefile

FROM debian:12
Expand All @@ -44,8 +54,8 @@ RUN set -eux; \
apt remove docker.io -y ; \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /work/build/aospace /usr/local/bin/aospace
COPY --from=builder /work/supervisord.conf /etc/supervisor/supervisord.conf
COPY --from=golang-builder /work/build/aospace /usr/local/bin/aospace
COPY --from=golang-builder /work/supervisord.conf /etc/supervisor/supervisord.conf

EXPOSE 5678

Expand Down