Skip to content

Commit

Permalink
feat(docker): add Dockerfile and docker-compose.yml to quickstart the…
Browse files Browse the repository at this point in the history
… app.
  • Loading branch information
amritupreti committed Jul 22, 2024
1 parent bfc8eae commit 28201e6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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 . .
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 28201e6

Please sign in to comment.