Skip to content
Snippets Groups Projects
Commit 4097b56a authored by Elian Loraux's avatar Elian Loraux
Browse files

divers

parent eec9c6a2
No related branches found
No related tags found
No related merge requests found
File moved
...@@ -2,11 +2,11 @@ const express = require('express'); ...@@ -2,11 +2,11 @@ const express = require('express');
const multer = require('multer'); const multer = require('multer');
const app = express(); const app = express();
const port = 3000; const port = 3000;
app.use('/static', express.static('uploads')); app.use('/static', express.static('upload'));
const storage = multer.diskStorage({ const storage = multer.diskStorage({
destination: function (req, file, cb) { destination: function (req, file, cb) {
cb(null, 'uploads/') // Make sure this folder exists cb(null, 'upload/') // Make sure this folder exists
}, },
filename: function (req, file, cb) { filename: function (req, file, cb) {
cb(null, file.fieldname + '-' + Date.now()) cb(null, file.fieldname + '-' + Date.now())
......
...@@ -4,12 +4,11 @@ services: ...@@ -4,12 +4,11 @@ services:
front: front:
build: build:
context: "docker/" context: "docker/"
volumes:
- ${PWD}:/app
environment: environment:
ENV: ENV:
volumes: volumes:
- ./upload:/upload - ./app:/app
- ./app/upload:/app/upload
httpd: httpd:
hostname: expose-scene-uploads hostname: expose-scene-uploads
...@@ -19,5 +18,5 @@ services: ...@@ -19,5 +18,5 @@ services:
- CORS_ALLOWED_HOSTS - CORS_ALLOWED_HOSTS
- WEBPACK_MODE=production - WEBPACK_MODE=production
volumes: volumes:
- ./upload:/srv - ./app/upload:/srv
- ./Caddyfile:/etc/caddy/Caddyfile - ./Caddyfile:/etc/caddy/Caddyfile
#!/bin/bash #!/bin/bash
npm install npm install
./cli post_install
if [ "$ENV" == "prod" ]; then if [ "$ENV" == "prod" ]; then
cmd="npm start" cmd="npm start"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment