Skip to content
Snippets Groups Projects
Commit 57028715 authored by Anthony's avatar Anthony
Browse files

Pakcahe everything in docker-compose

parent dbdd7b4d
Branches
No related tags found
No related merge requests found
# Use this variable to add configurations :
# docker-compose.yml : required
# ports.yml : bind the port 300 to the $PORT variable
# traefik.yml : add traefik configurations
COMPOSE_FILE=docker-compose.yml:docker/ports.yml
#COMPOSE_FILE=docker-compose.yml:docker/ports.yml:docker/traefik.yml
# Choose between "dev" and "prod"
ENV=dev
# If you use docker/ports.yml
PORT=3000
# If you use docker/traefik.yml
# A unique name for traefik router
NAME=
# A traefik host rule ex `domain.FQDN` or `domain1.FQDN`,`domain2.FQDN`
HOST=`domain.fqdn`
version: "3"
services:
front:
build:
context: "docker/"
volumes:
- ${PWD}:/app
environment:
ENV:
# From base image node
FROM node:16
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
VOLUME /app
# Copying all the files from your file system to container file system
COPY package.json .
WORKDIR /app
# Install all dependencies
RUN npm install
RUN ls -la
# Copy other files too
COPY ./ .
COPY entrypoint.sh /
# Expose the port
EXPOSE 3030
EXPOSE 3000
USER node
# Command to run app when intantiate an image
CMD ["npm","start"]
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
npm install
./cli post_install
if [ "$ENV" == "prod" ]; then
cmd="npm start"
else
cmd="npm start"
fi
if [ ! -z "$1" ]; then
cmd=$@
fi
exec $cmd
version: "3"
services:
front:
ports:
- ${PORT}:3000
const express = require('express');
const multer = require('multer');
const app = express();
const port = 3001;
const port = 3000;
app.use('/static', express.static('uploads'));
const storage = multer.diskStorage({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment