File tree 2 files changed +50
-4
lines changed
2 files changed +50
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,14 @@ RUN /tmp/atlas_install.sh
45
45
46
46
47
47
RUN mkdir -p /app/db/migrations
48
- COPY --from=builder /app/server /app/server
49
- COPY db/schema.sql /app/db/schema.sql
50
- COPY db/migrations/* /app/db/migrations
51
- RUN chmod +x /app/server
48
+
52
49
WORKDIR /app
50
+
51
+ COPY --from=builder /app/server /app/server
52
+ COPY db/schema.sql db/schema.sql
53
+ COPY db/migrations/*db/migrations
54
+ COPY public public
55
+ COPY templates templates
56
+ RUN chmod +x server
57
+
53
58
CMD ["/app/server" ]
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "embed"
4
+
5
+ // content holds our static web server content.
6
+ //go:embed db/migrations/* db/schema.sql
7
+ //go:embed templates/* public/*
8
+
9
+ //go:embed html/index.html
10
+ var content embed.FS
11
+
12
+ import (
13
+ "log"
14
+ "net/http"
15
+ api "openai-api-proxy/api"
16
+ proxy "openai-api-proxy/apiproxy"
17
+ auth "openai-api-proxy/auth"
18
+ db "openai-api-proxy/db"
19
+ web "openai-api-proxy/webui"
20
+
21
+ "github.com/joho/godotenv"
22
+ )
23
+
24
+ func main () {
25
+ log .Println ("openai-proxy started" )
26
+ err := godotenv .Load ()
27
+ if err != nil {
28
+ log .Println ("Warning: not able to loading Env File" , err )
29
+ }
30
+ db .DatabaseInit (content )
31
+ mux := http .NewServeMux ()
32
+ a := auth .Init (mux )
33
+ //
34
+ proxy .Init (mux ) // Start AI Proxy
35
+ go web .Init (mux , a , content ) // Start Web UI
36
+ go api .ApiInit (mux , a ) // Start Backend API
37
+
38
+ log .Printf ("Serving on http://localhost:%d" , 8082 )
39
+ log .Fatal (http .ListenAndServe (":8082" , mux ))
40
+
41
+ }
You can’t perform that action at this time.
0 commit comments