Skip to content

Commit

Permalink
storage config
Browse files Browse the repository at this point in the history
  • Loading branch information
juandjara committed May 12, 2020
1 parent 4c729fd commit 9d2722d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV=prod
REDIS_HOST=redis
REDIS_PORT=6379
STORAGE_PATH=/usr/app/storage
3 changes: 2 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const videoQueue = new Queue('video transcoding', {
})
videoQueue.process(processVideo)

app.use('/files', express.static(`${__dirname}/files`), serveIndex(`${__dirname}/files`, { icons: true }))
const storagePath = process.env.STORAGE_PATH || `${__dirname}/storage`
app.use('/files', express.static(storagePath), serveIndex(storagePath, { icons: true }))

app.get('/', (req, res) => {
res.json({
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
command: npm run dev
volumes:
- ./api:/usr/app
- ./api/storage:/usr/app/storage
ports:
- 4000:4000
- 9229:9229 # node debugger port
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ services:
build: api
command: npm start
restart: always
volumes:
- ./api/storage:/usr/app/storage
labels:
- traefik.enable=false
networks:
Expand Down

0 comments on commit 9d2722d

Please sign in to comment.