diff --git a/Dockerfile.backend b/Dockerfile.backend new file mode 100644 index 0000000..150ca4b --- /dev/null +++ b/Dockerfile.backend @@ -0,0 +1,22 @@ +FROM golang:1.19.1 AS builder + +### Copy Go code +WORKDIR /src/ +COPY . . + +### Build executables +RUN go build -o /app/webapi ./cmd/webapi + + +### Create final container +FROM debian:bullseye + +### Inform Docker about which port is used +EXPOSE 3000 4000 + +### Copy the build executable from the builder image +WORKDIR /app/ +COPY --from=builder /app/webapi ./ + +### Executable command +CMD ["/app/webapi"] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile.embedded similarity index 100% rename from Dockerfile rename to Dockerfile.embedded diff --git a/Dockerfile.frontend b/Dockerfile.frontend new file mode 100644 index 0000000..28608b4 --- /dev/null +++ b/Dockerfile.frontend @@ -0,0 +1,16 @@ +FROM node:lts as builder + +### Copy Vue.js code +WORKDIR /app +COPY webui webui + +### Build Vue.js into plain HTML/CSS/JS +WORKDIR /app/webui +RUN npm run build-prod + + +### Create final container +FROM nginx:stable + +### Copy the (built) app from the builder image +COPY --from=builder /app/webui/dist /usr/share/nginx/html \ No newline at end of file