Skip to content

Commit

Permalink
zess: badayeet
Browse files Browse the repository at this point in the history
  • Loading branch information
FKD13 committed Sep 11, 2024
1 parent e79ce1b commit 8d8e544
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
# Build backend
FROM golang:1.22.1-alpine3.19 as build_backend
FROM rust:1.81-alpine3.20 as build_backend

RUN apk add upx alpine-sdk
RUN apk add upx musl-dev

WORKDIR /

COPY vingo/go.sum go.sum
COPY vingo/Cargo.* .

COPY vingo/go.mod go.mod
COPY vingo/migration migration

RUN go mod download

COPY vingo/main.go .

COPY vingo/database database

COPY vingo/handlers handlers

RUN CGO_ENABLED=1 go build -ldflags "-s -w" -v -tags musl vingo/.

RUN upx --best --lzma vingo
COPY vingo/src src

RUN cargo build --release

RUN upx --best --lzma target/release/vingo

# Build frontend
FROM node:20.15.1-alpine3.20 as build_frontend
Expand All @@ -40,14 +32,12 @@ COPY vinvoor/production.env .env

RUN yarn run build



# End container
FROM alpine:3.19

WORKDIR /

COPY --from=build_backend vingo .
COPY --from=build_backend target/release/vingo .
COPY --from=build_frontend /dist public

ENV DEVELOPMENT=false
Expand Down

0 comments on commit 8d8e544

Please sign in to comment.