Skip to content

Commit

Permalink
Merge branch 'main' into docs/containerize
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinanielsen authored Jul 26, 2024
2 parents 355c013 + 68b3871 commit 19418ee
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Build the UI
FROM node:18.17.0-bullseye-slim AS nodework
WORKDIR /app
COPY ui/ .
RUN npm install
RUN npm run build

# Build the Go binary
FROM golang:1.22 AS gowork
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download

COPY . .
COPY --from=nodework /app/build ui/build
RUN go build -o /app/main .


# Run the binary in a alpine container
FROM ubuntu:22.04
WORKDIR /app
COPY --from=gowork /app/main .
CMD [ "./main" ]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
server:
image: go-fast-cdn
build: .
ports:
- "8080:8080"
volumes:
- uploads:/app/uploads
- db_data:/app/db_data
container_name: go-fast-cdn
volumes:
db_data:
uploads:

0 comments on commit 19418ee

Please sign in to comment.