Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hizla
waitlist
backend
Commits
b6b899f1
Commit
b6b899f1
authored
6 months ago
by
Levatax
Browse files
Options
Downloads
Patches
Plain Diff
build: add Dockerfile
parent
081192c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#985
passed
6 months ago
Stage: lint
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+38
-0
38 additions, 0 deletions
Dockerfile
with
38 additions
and
0 deletions
Dockerfile
0 → 100644
+
38
−
0
View file @
b6b899f1
# Start from the official Golang image
FROM
golang:1.22-alpine
as
builder
# Set the working directory inside the container
WORKDIR
/app
# Install necessary packages
RUN
apk add
--no-cache
git
# Copy go.mod and go.sum files to install dependencies
COPY
go.mod go.sum ./
# Download and cache dependencies
RUN
go mod download
# Copy the rest of the application source code
COPY
. .
# Build the application
RUN
go build
-o
waitlist .
# Start a new minimal image for the application
FROM
alpine:latest
# Set the working directory inside the new container
WORKDIR
/app
# Install necessary packages in the minimal image
RUN
apk add
--no-cache
ca-certificates
# Copy the built binary from the previous stage
COPY
--from=builder /app/waitlist .
# Expose the port the app runs on
EXPOSE
3000
# Run the application
CMD
["./waitlist"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment