Skip to content

Commit

Permalink
enabled devcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-129 committed Oct 8, 2024
1 parent bf85340 commit 8b791e3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#BUILDER
FROM node:19-alpine as builder

#Make the builder directory
WORKDIR /website_fosscu

#COPY build source from project
COPY package*.json .
COPY yarn.lock .

#Copy all files into container
COPY . .

#Installing all dependencies
RUN yarn install


#MAIN
FROM node:19-alpine as main

#Make main app directory
WORKDIR /app

#Copy all from builder stage
COPY --from=builder /website_fosscu/. ./

# Run the production build
RUN yarn build

# Start the server
CMD ["yarn", "start"]
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "website-fosscu",
"dockerFile": "Dockerfile",
"context": "..",
"remoteUser": "node",
"forwardPorts": [8080],
"postCreateCommand": "yarn",
"shutdownAction": "none",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"editor.formatOnSave": true,
"eslint.alwaysShowStatus": true
},
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker"
]
}
}
}
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ export default defineConfig({
},
define: {
'process.env': process.env
},
server: {
port: 8080, // Set the desired port here
}
});

0 comments on commit 8b791e3

Please sign in to comment.