Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules/
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:16

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --only=production


# Bundle app source
COPY . .

ARG BUILD_MODE=development
# build with webpack
RUN npx webpack build --config ./webpack.config.js --mode $BUILD_MODE


EXPOSE 3000
CMD [ "node", "server/server.js" ]
2 changes: 1 addition & 1 deletion client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class App extends Component {
handleLogin = () => {
let oldLink = window.location.pathname + window.location.search;
let link = window.location.origin.replace("http:", "https:") + "/api/signUpLogin";
if (link.includes("localhost:5000")) link = window.location.origin + "/api/signUpLogin";
if (link.includes("localhost:5000") || link.includes("localhost:3000")) link = window.location.origin + "/api/signUpLogin"; // TODO: There has to be a better way to detect if we're running a dev build
let encodedLink = encodeURIComponent(link);

this.props.cookies.set("redirectLink", oldLink, { path: "/" });
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3.9"

services:
web-dev:
build:
context: .
args:
- BUILD_MODE=development
ports:
- "3000:3000"
depends_on:
- mongo-dev
environment:
- FIREROAD_LINK=https://fireroad-dev.mit.edu/
- DATABASE_NAME=dev
- ATLAS_SRV=mongodb://root:example@mongo-dev:27017
- ENV=development
mongo-dev:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example