Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (36 loc) · 1.49 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Hello world example with go
# We specify the base image we need for our
# go application
FROM golang:1.10
# We create an /app directory within our
# image that will hold our application source
# files
RUN mkdir /app
# We copy everything in the root directory
# into our /app directory
ADD . /app
RUN touch /app/.env
# We specify that we now wish to execute
# any further commands inside our /app
# directory
WORKDIR /app
# #Import local packages
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/config/mdb"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/controllers/productscontroller"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/models/productsmodel"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/models/usersmodel"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/controllers/userscontroller"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/utils"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/middleware/auth"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/middleware/common"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/routes"
RUN go get -u "github.com/maxwellgithinji/farmsale_backend/models/jwtmodel"
#Import experimental packages
RUN go get "golang.org/x/crypto/bcrypt"
RUN go get "go.mongodb.org/mongo-driver/x/bsonx"
# we run go build to compile the binary
# executable of our Go program
RUN go build -o main
# Our start command which kicks off
# our newly created binary executable
CMD ["/app/main"]