@@ -38,7 +38,7 @@ def self_hosting():
38
38
doctext (
39
39
"Clone your code to a server and install the " ,
40
40
doclink ("requirements" , href = installation .path ),
41
- ". " ,
41
+ "." ,
42
42
),
43
43
subheader ("Edit Config" ),
44
44
doctext (
@@ -49,7 +49,7 @@ def self_hosting():
49
49
" at the end." ,
50
50
),
51
51
doctext (
52
- "For example if your server is at 192.168.1.1, your config would look like this: "
52
+ "For example if your server is at 192.168.1.1, your config would look like this:"
53
53
),
54
54
doccode (
55
55
"""config = pc.Config(
@@ -60,7 +60,7 @@ def self_hosting():
60
60
)
61
61
""" ,
62
62
),
63
- doctext ("Then run your app in production mode: " ),
63
+ doctext ("Then run your app in production mode:" ),
64
64
doccode ("$ pc run --env prod" , language = "bash" ),
65
65
doctext (
66
66
" Production mode creates an optimized build of your app." ,
@@ -93,4 +93,67 @@ def self_hosting():
93
93
pc .code ("--backend-only" ),
94
94
" flags." ,
95
95
),
96
+ subheader ("Pynecone Container Service" ),
97
+ doctext (
98
+ "Another option is to run your Pynecone service in a container." ,
99
+ "For this purpose, a " ,
100
+ pc .code ("Dockerfile" ),
101
+ " and additional documentation is available in the Pynecone project in the directory " ,
102
+ pc .code ("docker-example" ),
103
+ ". " ,
104
+ ),
105
+ doctext (
106
+ "For the build of the container image it is necessary to edit the " ,
107
+ pc .code ("pcconfig.py" ),
108
+ " and the add the " ,
109
+ pc .code ("requirements.txt" ),
110
+ " to your project folder. The following changes are necessary in " ,
111
+ pc .code ("pcconfig.py" ),
112
+ ":" ,
113
+ ),
114
+ doccode (
115
+ """config = pc.Config(
116
+ app_name="app",
117
+ api_url="0.0.0.0:8000",
118
+ bun_path="/app/.bun/bin/bun",
119
+ db_url="sqlite:///pynecone.db",
120
+ )
121
+ """ ,
122
+ ),
123
+ doctext (
124
+ "You can find the " ,
125
+ pc .code ("requirements.txt" ),
126
+ " in the " ,
127
+ pc .code ("docker-example" ),
128
+ " folder of the project too."
129
+ ),
130
+ doctext (
131
+ "The project structure should looks like this:" ,
132
+ ),
133
+ doccode (
134
+ """hello
135
+ ├── .web
136
+ ├── assets
137
+ ├── hello
138
+ │ ├── __init__.py
139
+ │ └── hello.py
140
+ ├── pcconfig.py
141
+ ├── Dockerfile
142
+ └── requirements.txt""" ,
143
+ language = "bash" ,
144
+ ),
145
+ doctext (
146
+ "After all changes have been made, the container image can now be created as follows." ,
147
+ ),
148
+ doccode (
149
+ """$ docker build -t pynecone-project:latest .""" ,
150
+ language = "bash" ,
151
+ ),
152
+ doctext (
153
+ "Finally, you can start your Pynecone container service as follows." ,
154
+ ),
155
+ doccode (
156
+ """$ docker run -d -p 3000:3000 -p 8000:8000 --name pynecone pynecone:latest""" ,
157
+ language = "bash" ,
158
+ ),
96
159
)
0 commit comments