Skip to content

Commit 313fcd6

Browse files
jklugeLSKpr
andauthored
Docker Setup (#18)
* Initial Dockerfiles * Docker Setup finalized * Remove some comments * Wrong app name * Small changes xD * Update .dockerignore * Always do npm ci --------- Co-authored-by: Kacper Lisik <lisik@kth.se>
1 parent 27a5b77 commit 313fcd6

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
node_modules
3+
dist
4+
.env

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node:18-alpine
2+
WORKDIR /app
3+
COPY my-app .
4+
RUN npm ci
5+
EXPOSE 5173
6+
CMD ["npm", "run", "dev"]

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
container_name: my-app
7+
ports:
8+
- "5173:5173"
9+
volumes:
10+
- ./my-app:/app # mount local 'my-app' to /app inside the container
11+
environment:
12+
- NODE_ENV=development # set environment variable to development
13+
command: npm run dev
14+
stdin_open: true # interactive sessions
15+
tty: true # keep the container running interactively

my-app/vite.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ export default defineConfig({
66
plugins: [react(),
77
tailwindcss(),
88
],
9+
server: {
10+
host: '0.0.0.0', // Allow external access
11+
port: 5173,
12+
}
913
})

0 commit comments

Comments
 (0)