New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ponzu works fine locally but when I deploy it the content doesn't show up. #129
Comments
How are you doing the deployment? Could you outline the exact steps you're taking from your development environment to deploy? |
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 |
Are you sure that the |
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
|
thats the output of the docker build locally |
@Nemesisesq - Are you seeing either of them in your admin UI? |
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. |
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? |
yeah I am not including system or analytics db. And I'm still not seeing hello or tooltip in the admin. |
So the steps you are taking are these:
Correct? Do you have a .dockerignore file? If so, can you paste it in this thread? |
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? |
Thank you for your help I really appreciate it. |
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. |
When I deploy ponzu with docker the ponzu build isn't creating the models properly so there are no contents on the admin page. When go to the type of the content that should be there. I get a 400
The text was updated successfully, but these errors were encountered: