use template files instead of statik in dev Dockerfile
This commit is contained in:
committed by
Umputun
parent
36dce6c2ac
commit
bec6bcee0d
+1
-2
@@ -33,8 +33,6 @@ RUN \
|
||||
if [ -z "$DRONE" ] ; then echo "runs outside of drone" && version="$(/script/git-rev.sh)" ; \
|
||||
else version=${DRONE_TAG}${DRONE_BRANCH}${DRONE_PULL_REQUEST}-${DRONE_COMMIT:0:7}-$(date +%Y%m%d-%H:%M:%S) ; fi && \
|
||||
echo "version=$version" && \
|
||||
statik --src=/build/backend/templates --dest=/build/backend/app -p templates -ns templates -f && \
|
||||
ls -la /build/backend/app/templates/statik.go && \
|
||||
go build -o remark42 -ldflags "-X main.revision=${version} -s -w" ./app
|
||||
|
||||
FROM node:12.16-alpine as build-frontend-deps
|
||||
@@ -71,6 +69,7 @@ ADD backend/scripts/import.sh /usr/local/bin/import
|
||||
RUN chmod +x /entrypoint.sh /usr/local/bin/backup /usr/local/bin/restore /usr/local/bin/import
|
||||
|
||||
COPY --from=build-backend /build/backend/remark42 /srv/remark42
|
||||
COPY --from=build-backend /build/backend/templates /srv
|
||||
COPY --from=build-frontend /srv/frontend/public/ /srv/web
|
||||
RUN chown -R app:app /srv
|
||||
RUN ln -s /srv/remark42 /usr/bin/remark42
|
||||
|
||||
@@ -32,7 +32,7 @@ func NewFS() *FS {
|
||||
// ReadFile depends on statik achieve exists
|
||||
func (f *FS) ReadFile(path string) ([]byte, error) {
|
||||
if f.statik != nil {
|
||||
return fs.ReadFile(f.statik, filepath.Join("/", path))
|
||||
return fs.ReadFile(f.statik, filepath.Join("/", path)) //nolint:gocritic // root folder is a requirement for statik
|
||||
}
|
||||
return ioutil.ReadFile(filepath.Join("./", filepath.Clean(path)))
|
||||
return ioutil.ReadFile(filepath.Clean(path))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user