Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wg-gen-web
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
wg-gen-web
Commits
4edd5cb4
Commit
4edd5cb4
authored
Feb 5, 2020
by
vx3r
Browse files
Options
Downloads
Patches
Plain Diff
cd/cd docker build from Dockerfile
parent
26dec5ce
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+10
-25
10 additions, 25 deletions
.gitlab-ci.yml
Dockerfile
+15
-8
15 additions, 8 deletions
Dockerfile
Dockerfile.dev
+0
-21
0 additions, 21 deletions
Dockerfile.dev
with
25 additions
and
54 deletions
.gitlab-ci.yml
+
10
−
25
View file @
4edd5cb4
stages
:
stages
:
-
build
-
build
docker image
-
deploy
-
push docker hub
build-back
:
build
:
stage
:
build
stage
:
build docker image
image
:
golang:alpine
image
:
docker:latest
script
:
-
go build -o ${CI_PROJECT_NAME}-linux-amd64
artifacts
:
paths
:
-
${CI_PROJECT_NAME}-linux-amd64
build-front
:
stage
:
build
image
:
node:10-alpine
script
:
script
:
-
cd ./ui
-
docker info
-
npm install
-
docker build --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:latest .
-
npm run build
-
cd ..
artifacts
:
paths
:
-
ui/dist
deploy
:
push
:
stage
:
deploy
stage
:
push docker hub
image
:
docker:latest
image
:
docker:latest
only
:
only
:
-
master
-
master
script
:
script
:
-
docker login -u ${CI_REGISTRY_USER} -p ${REGISTRY_PASSWORD} ${CI_REGISTRY}
-
echo ${REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
-
docker build --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:latest .
-
docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
-
docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
-
docker push ${CI_REGISTRY_IMAGE}:latest
-
docker push ${CI_REGISTRY_IMAGE}:latest
This diff is collapsed.
Click to expand it.
Dockerfile
+
15
−
8
View file @
4edd5cb4
FROM
alpine
FROM
golang:alpine
AS
build-back
WORKDIR
/app
ADD
. .
RUN
go build
-o
wg-gen-web-linux
FROM
node:10-alpine
as
build-front
WORKDIR
/app
WORKDIR
/app
ADD
ui .
RUN
npm
install
RUN
npm run build
ADD
wg-gen-web-linux-amd64 .
FROM
alpine
WORKDIR
/app
COPY
--from=build-back /app/wg-gen-web-linux .
COPY
--from=build-front /app/dist ./ui/dist
ADD
.env .
ADD
.env .
ADD
ui/dist ui/dist
RUN
chmod
+x ./wg-gen-web-linux
RUN
apk add
--no-cache
ca-certificates
RUN
chmod
+x ./wg-gen-web-linux-amd64
RUN
apk update
&&
apk
--no-cache
add wget ca-certificates
EXPOSE
8080
EXPOSE
8080
CMD
["/app/wg-gen-web-linux
-amd64
"]
CMD
["/app/wg-gen-web-linux"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile.dev
deleted
100644 → 0
+
0
−
21
View file @
26dec5ce
FROM golang:alpine AS build-back
WORKDIR /app
ADD . .
RUN go build -o wg-gen-web-linux-amd64
FROM node:10-alpine as build-front
WORKDIR /app
ADD ui .
RUN npm install
RUN npm run build
FROM alpine
WORKDIR /app
COPY --from=build-back /app/wg-gen-web-linux-amd64 .
COPY --from=build-front /app/dist ./ui/dist
ADD .env .
RUN chmod +x ./wg-gen-web-linux-amd64
RUN apk add --no-cache ca-certificates
EXPOSE 8080
CMD ["/app/wg-gen-web-linux-amd64"]
\ 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