Skip to content

Commit

Permalink
chores(build): some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed Mar 14, 2024
1 parent 1c0f6f6 commit b6d44e0
Show file tree
Hide file tree
Showing 8 changed files with 14,658 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-n-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile.production
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ bin
data/*
!data/.gitkeep
firmware.bin
tx16s-internal-elrs.json
*.paw
static
package-lock.json
ui/.env
28 changes: 22 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
FROM golang:1.20-bullseye
FROM golang:1.20-bullseye as builder

ENV VERSION_ID Debian_11
RUN mkdir /build
ADD . /build/
WORKDIR /build

RUN make build

FROM node:slim as ui-builder

RUN mkdir /build
ADD . /build/
WORKDIR /build

RUN npm ci --prefix ui/
RUN npm run build --prefix ui/

FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get -y install curl gnupg2 git \
&& echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${VERSION_ID}/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
&& curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${VERSION_ID}/Release.key" | apt-key add - \
&& apt-get update && apt-get -y upgrade && apt-get -y install podman dumb-init \
&& apt-get -y install curl gnupg2 git podman dumb-init \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --create-home --shell /bin/bash rootless
RUN mkdir -p /home/rootless/src
WORKDIR /home/rootless/src

USER rootless
COPY --from=builder /build/bin/ebuild ./
COPY --from=builder /build/targets.json ./
COPY --from=ui-builder /build/static ./static

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash"]
33 changes: 0 additions & 33 deletions Dockerfile.production

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
command: ./ebuild run api
build:
context: .
dockerfile: Dockerfile.production
dockerfile: Dockerfile
env_file:
- ./api.env
networks:
Expand Down
3 changes: 0 additions & 3 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# taboo
package-lock.json

# Logs
logs
*.log
Expand Down
Loading

0 comments on commit b6d44e0

Please sign in to comment.