diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 0000000..d381c20 --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,32 @@ +services: + reverse_proxy: + build: ./proxy + restart: always + ports: + - "80:80" + + front: + build: + context: ./traque-front + dockerfile: Dockerfile.dev + restart: always + volumes: + - ./traque-front:/app + - /app/node_modules + environment: + NEXT_PUBLIC_SOCKET_HOST: 'localhost' + + back: + build: + context: ./traque-back + dockerfile: Dockerfile.dev + restart: always + ports: + - "3001:3001" + volumes: + - ./traque-back:/app + - /app/node_modules + environment: + ADMIN_PASSWORD_HASH: '23e3c6886ff8fcba302deac05c46612ed3af99e40a2a14252810f540f3c186aa' + HOST: '0.0.0.0' + PORT: 3001 diff --git a/traque-back/Dockerfile.dev b/traque-back/Dockerfile.dev new file mode 100644 index 0000000..3bd9073 --- /dev/null +++ b/traque-back/Dockerfile.dev @@ -0,0 +1,27 @@ +# Use Node 22 alpine as parent image +FROM node:22-alpine + +# Change the working directory on the Docker image to /app +WORKDIR /app + +# Change specified variables +ENV NODE_ENV=development + +# Copy package.json and package-lock.json to the /app directory +COPY package.json package-lock.json* ./ + +# Install dependencies +RUN npm install + +# Copy the rest of project files into this image +COPY . . + +# Create those folders if they don't already exist +RUN if [ ! -d uploads ]; then mkdir uploads; fi +RUN if [ ! -d trajectories ]; then mkdir trajectories; fi + +# Expose the port +EXPOSE 3001 + +# Start the server in dev mode +CMD ["npm", "run", "dev"] diff --git a/traque-front/Dockerfile.dev b/traque-front/Dockerfile.dev new file mode 100644 index 0000000..a15ee97 --- /dev/null +++ b/traque-front/Dockerfile.dev @@ -0,0 +1,27 @@ +# Use Node 22 alpine as parent image +FROM node:22-alpine + +# Change the working directory on the Docker image to /app +WORKDIR /app + +# Installs glibc compatibility on Alpine to support native Node.js modules that require glibc +RUN apk add --no-cache libc6-compat + +# Change specified variables +ENV NODE_ENV=development +ENV NEXT_TELEMETRY_DISABLED=1 + +# Copy package.json and package-lock.json to the /app directory +COPY package.json package-lock.json* ./ + +# Install dependencies +RUN npm install + +# Copy the rest of project files into this image +COPY . . + +# Expose the port +EXPOSE 3000 + +# Start the server in dev mode +CMD ["npm", "run", "dev"]