feat: db file to data directory
This commit is contained in:
parent
3bb5909053
commit
873e8dfd2b
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ pastebin
|
|||||||
pastebin.exe
|
pastebin.exe
|
||||||
pastebin.exe~
|
pastebin.exe~
|
||||||
pastebin.db
|
pastebin.db
|
||||||
|
data/pastebin.db
|
10
Dockerfile
10
Dockerfile
@ -4,10 +4,10 @@ COPY ./webui .
|
|||||||
RUN npm install && npm run build
|
RUN npm install && npm run build
|
||||||
|
|
||||||
FROM images.local/golang:latest
|
FROM images.local/golang:latest
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
COPY --from=0 dist /app/webui/dist
|
||||||
|
RUN go mod tidy && go build .
|
||||||
|
|
||||||
COPY . .
|
EXPOSE 38081
|
||||||
COPY --from=0 dist ./webui/dist
|
|
||||||
RUN buf generate && go mod tidy && go build .
|
|
||||||
|
|
||||||
EXPOSE 38080
|
|
||||||
ENTRYPOINT [ "./pastebin", "api" ]
|
ENTRYPOINT [ "./pastebin", "api" ]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
server-name: pastebin
|
server-name: pastebin
|
||||||
server-listen: 127.0.0.1:38080
|
server-listen: 127.0.0.1:38082
|
||||||
environment: dev
|
environment: dev
|
||||||
db:
|
db:
|
||||||
dbname: pastebin.db
|
dbname: data/pastebin.db
|
||||||
debug: true
|
debug: true
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
server-name: pastebin
|
server-name: pastebin
|
||||||
server-listen: 0.0.0.0:38080
|
server-listen: 0.0.0.0:38082
|
||||||
environment: prod
|
environment: prod
|
||||||
db:
|
db:
|
||||||
dbname: pastebin.db
|
dbname: data/pastebin.db
|
||||||
debug: true
|
debug: true
|
||||||
|
0
data/.gitkeep
Normal file
0
data/.gitkeep
Normal file
@ -2,10 +2,10 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: xuthus5/pastebin:latest
|
image: images.local/pastebin:latest
|
||||||
container_name: pastebin
|
container_name: pastebin
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- /data/containers/pastebin:/app/data
|
- /data/containers/pastebin/pastebin.db:/app/pastebin.db
|
||||||
ports:
|
ports:
|
||||||
- "30001:38080"
|
- "30002:38082"
|
||||||
|
Loading…
Reference in New Issue
Block a user