Comments (13)
How are you doing the deployment? Could you outline the exact steps you're taking from your development environment to deploy?
from ponzu.
I have my elastic beanstalk set to deploy a zip with the app, a Dockerfile and a Dockerrun.aws.json file as well.
Here's my docker file
FROM golang:1.8
COPY startup.sh /startup.sh
RUN go get github.com/ponzu-cms/ponzu/...
RUN mkdir /app
ADD . /app/
RUN cd /app
WORKDIR /app
EXPOSE 8080
RUN chmod -R 700 /startup.sh
ENTRYPOINT ["/bin/bash", "/startup.sh"]
startup.sh is
#!/usr/bin/env bash
ponzu build && ponzu run
from ponzu.
Are you sure that the ADD . /app/
line is providing the files from the unzipped app to the container? It seems like the problem is that the content
package files that you created are not being added. Maybe add a RUN ls /app/content
line to see what is there at deploy time (assuming you can see the output of the docker build.)
from ponzu.
package content
import (
"fmt"
"github.com/ponzu-cms/ponzu/management/editor"
"github.com/ponzu-cms/ponzu/system/item"
)
type Hello struct {
item.Item
World string `json:"world"`
}
// MarshalEditor writes a buffer of html to edit a Hello within the CMS
// and implements editor.Editable
func (h *Hello) MarshalEditor() ([]byte, error) {
view, err := editor.Form(h,
// Take note that the first argument to these Input-like functions
// is the string version of each Hello field, and must follow
// this pattern for auto-decoding and auto-encoding reasons:
editor.Field{
View: editor.Input("World", h, map[string]string{
"label": "World",
"type": "text",
"placeholder": "Enter the World here",
}),
},
)
if err != nil {
return nil, fmt.Errorf("Failed to render Hello editor view: %s", err.Error())
}
return view, nil
}
func init() {
item.Types["Hello"] = func() interface{} { return new(Hello) }
}
---> 2e17051781b7
Removing intermediate container 64320a4ae687
Step 11/15 : RUN cat /app/content/tooltip.go
---> Running in 73e527f70e5a
package content
import (
"fmt"
"github.com/ponzu-cms/ponzu/management/editor"
"github.com/ponzu-cms/ponzu/system/item"
)
type Tooltip struct {
item.Item
Name string `json:"name"`
Title string `json:"title"`
Body string `json:"body"`
}
// MarshalEditor writes a buffer of html to edit a Tooltip within the CMS
// and implements editor.Editable
func (t *Tooltip) MarshalEditor() ([]byte, error) {
view, err := editor.Form(t,
// Take note that the first argument to these Input-like functions
// is the string version of each Tooltip field, and must follow
// this pattern for auto-decoding and auto-encoding reasons:
editor.Field{
View: editor.Input("Name", t, map[string]string{
"label": "Name",
"type": "text",
"placeholder": "Enter the Name here",
}),
},
editor.Field{
View: editor.Input("Title", t, map[string]string{
"label": "Title",
"type": "text",
"placeholder": "Enter the Title here",
}),
},
editor.Field{
View: editor.Textarea("Body", t, map[string]string{
"label": "Body",
"placeholder": "Enter the Body here",
}),
},
)
if err != nil {
return nil, fmt.Errorf("Failed to render Tooltip editor view: %s", err.Error())
}
return view, nil
}
func init() {
item.Types["Tooltip"] = func() interface{} { return new(Tooltip) }
}
---> a31788859947
Removing intermediate container 73e527f70e5a
Step 12/15 : RUN ls /app
---> Running in 1f39c0d12f71
Dockerfile
Dockerrun.aws.json
LICENSE
README.md
addons
analytics.db
bundle.zip
cmd
content
deployment
examples
ponzu-banner.png
startup.sh
system.db
uploads
---> 23b9f9ff7c8b
Removing intermediate container 1f39c0d12f71
Step 13/15 : RUN ponzu build
---> Running in 7b628e44a7db
---> da2ea12f0c53
Removing intermediate container 7b628e44a7db
Step 14/15 : RUN ls /app
---> Running in baa8a1921bad
Dockerfile
Dockerrun.aws.json
LICENSE
README.md
addons
analytics.db
bundle.zip
cmd
content
deployment
examples
ponzu-banner.png
ponzu-server
startup.sh
system.db
uploads
---> f65dc70016cd
Removing intermediate container baa8a1921bad
Step 15/15 : CMD ponzu run
---> Running in c1490deb8be5
---> 183d8e4c281b
Removing intermediate container c1490deb8be5
Successfully built 183d8e4c281b
from ponzu.
thats the output of the docker build locally
from ponzu.
@Nemesisesq -
Are you expecting to see both the content/hello.go
and content/tooltip.go
? You pasted hello.go in the comment and then ran RUN cat /app/content/tooltip.go
in the docker output.
Are you seeing either of them in your admin UI?
from ponzu.
I am not seeing them in the admin UI when I build and run the docker container. when I run ponzu build && ponzu run from my computer it worlds and I can see the contents in the UI. When I run docker locally it is not. I am making sure the container is building properly.
from ponzu.
Is anything being restored from you local build? For example, do you need to re-initialize the CMS with your email / password./ CMS name / host etc? (indicating that system.db isn't loaded), or are the configuration setting all the same from local to docker?
from ponzu.
yeah I am not including system or analytics db. And I'm still not seeing hello or tooltip in the admin.
from ponzu.
So the steps you are taking are these:
- bundle your local zip and deploy
- docker build with the unzipped app, ignoring the *.db files
- run ponzu, visit $YOUR_IP:8080/admin
- you're redirected to $YOUR_IP:8080/admin/init
- you fill out the initialization, and are redirected to $YOUR_IP:8080/admin
- nothing is listed in the Content section of your UI
Correct?
Do you have a .dockerignore file? If so, can you paste it in this thread?
from ponzu.
So I got it working inside docker I'm not exactly sure how. I think it had to do with how I was adding the directories. Is it possible to save the data to mongo db or something? or a db with some more persistence?
from ponzu.
Thank you for your help I really appreciate it.
from ponzu.
Glad it is working for you! Happy to help.
You should try to create a volume (see docker docs) between your host and container so the db files persist between builds. We only support BoltDb as of now, but may consider adding optional db backends including mongo in the future.
from ponzu.
Related Issues (20)
- CLI is not working HOT 14
- Zap v11 was deleted HOT 14
- go module support HOT 9
- search sort HOT 2
- Custom databases HOT 3
- ponzu 0.11.0 fails to build HOT 2
- The "must" search operator in blevesearch can't be passed into ponzu HOT 1
- NOTICE: original author & maintainer is stepping away from the project HOT 7
- how to change to Summernote
- Redis Support for ponzu
- There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.
- Only latest tag saving
- Error with "go get..." HOT 6
- Current state of Ponzu HOT 1
- Is this project still maintained? HOT 3
- Suggested install method no longer works HOT 2
- Is Ponzu dead? HOT 10
- Potential goroutine leak in achive.go
- How can you develop addons more efficiently?
- How to setup development env
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ponzu.