Skip to content

Commit

Permalink
Issue umputun#31: Replace separate UI with the embedded HTMX based
Browse files Browse the repository at this point in the history
   - updated Docker files to build the app correctly
  • Loading branch information
oneils committed Oct 5, 2023
1 parent 91b3898 commit e436f70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG SKIP_TEST
ENV GOFLAGS="-mod=vendor"

ADD backend /build/secrets
ADD backend/ui/static /build/secrets/ui/static
ADD .git /build/secrets/.git
WORKDIR /build/secrets

Expand All @@ -27,21 +28,10 @@ RUN \
go build -o secrets -ldflags "-X main.revision=${version} -s -w" ./app


FROM node:10.19.0-alpine3.11 as build-frontend
WORKDIR /srv/frontend/

RUN apk add --no-cache --update git python make g++
COPY ./frontend/package.json ./frontend/package-lock.json ./
RUN npm install

COPY ./frontend /srv/frontend
RUN npm run build
RUN npm prune --production

FROM umputun/baseimage:app-latest

COPY --from=build-backend /build/secrets/secrets /srv/secrets
COPY --from=build-frontend /srv/frontend/public/ /srv/docroot
COPY --from=build-backend /build/secrets/ui/static /srv/ui/static/

WORKDIR /srv
EXPOSE 8080
Expand Down
1 change: 1 addition & 0 deletions backend/ui/efs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package ui provides embedded static files
package ui

import "embed"
Expand Down
1 change: 1 addition & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ services:
- BOLT_FILE=/data/secrets.bd
- PIN_ATTEMPTS=3
- MAX_EXPIRE=24h
- DOMAIN=localhost:8080
ports:
- "8080:8080"
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- BOLT_FILE=/data/secrets.bd
- PIN_ATTEMPTS=3
- MAX_EXPIRE=24h
- DOMAIN=www.example.com # important! change to your domain
# uncomment to expose directly without nginx proxy
# ports:
# - "80:8080"
Expand Down

0 comments on commit e436f70

Please sign in to comment.