Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
json-utility
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Ivanov, Ivan (UG - Computer Science)
json-utility
Commits
df8f1a76
Commit
df8f1a76
authored
4 years ago
by
Ivan Ivanov
Browse files
Options
Downloads
Patches
Plain Diff
Containerisation of the API works.
parent
df125aac
No related branches found
No related tags found
1 merge request
!5
Containerised
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+28
-4
28 additions, 4 deletions
Dockerfile
docker-compose.yaml
+10
-0
10 additions, 0 deletions
docker-compose.yaml
with
38 additions
and
4 deletions
Dockerfile
+
28
−
4
View file @
df8f1a76
FROM
golang:1.16.2-buster
# Start from golang base image
WORKDIR
.
FROM
golang:alpine
# The latest alpine images don't have some tools like (`git` and `bash`).
# Adding git, bash and openssh to the image
RUN
apk update
&&
apk upgrade
&&
\
apk add
--no-cache
bash git openssh build-base
# Set the current working directory inside the container
WORKDIR
/app
# Copy go mod and sum files
COPY
go.mod go.sum ./
# Download all dependencies. Dependencies will be cached if the go.mod and the go.sum files are not changed
RUN
go mod download
# Copy the source from the current directory to the working Directory inside the container
COPY
. .
COPY
. .
RUN
make build
RUN
make build
file
=
example.json
# Build the Go app
\ No newline at end of file
RUN
go build
# Expose port 8080 to the outside world
EXPOSE
8080
RUN
chmod
+x /app/json-utility
#Command to run the executable
CMD
["./json-utility", "CONTAINER"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.yaml
+
10
−
0
View file @
df8f1a76
version
:
"
3"
services
:
app
:
container_name
:
rest-api-json
build
:
.
restart
:
on-failure
volumes
:
-
.:/usr/src/app/
ports
:
-
8080:8080
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