Skip to content

Commit

Permalink
add docker-compose example, fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Jun 7, 2023
1 parent 2d3542f commit 6289a86
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
nginx:
image: nginx
ports:
- 80:80
volumes:
- html:/usr/share/nginx/html:ro

api-notes:
image: ghcr.io/reddec/api-notes:0.0.1-next-amd64
ports:
- 127.0.0.1:8080:8080
environment:
PUBLIC_URL: http://localhost

volumes:
- html:/data

volumes:
html: {}
5 changes: 4 additions & 1 deletion internal/storage/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ func (l *Local) Set(_ context.Context, uid string, content io.Reader) error {
if err := tmp.Close(); err != nil {
return fmt.Errorf("close temp: %w", err)
}
return os.Rename(tmp.Name(), p)
if err := os.Rename(tmp.Name(), p); err != nil {
return fmt.Errorf("rename: %w", err)
}
return os.Chmod(p, 0755)
}

func (l *Local) Delete(_ context.Context, uid string) error {
Expand Down

0 comments on commit 6289a86

Please sign in to comment.