-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
132 lines (82 loc) · 2.49 KB
/
Dockerfile
File metadata and controls
132 lines (82 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#example of a python app
# Use an official Python runtime as a parent image
FROM python:3.8-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 80
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["python", "app.py"]
#------------------------------------------------------------------------------------
#example of node js and express.js api
# Use the official Node.js image
FROM node:16
# Set the working directory
WORKDIR /app
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application (if needed)
# RUN npm run build
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["node", "server.js"]
#------------------------------------------------------------------------------------
# example of react app with vite
# Use the official Node.js image
FROM node:16
# Set the working directory
WORKDIR /app
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the React app
RUN npm run build
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["npm", "run", "dev"]
#------------------------------------------------------------------------------------
# example of react app with vite
# Use the official Node.js image
FROM node:16
# Set the working directory
WORKDIR /app
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the React app
RUN npm run build
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["npm", "run", "dev"]
#------------------------------------------------------------------------------------
# example of flutter app
# Use the official Dart image as a base
FROM cirrusci/flutter:2.10.5
# Set the working directory
WORKDIR /app
# Copy the Flutter application code
COPY . .
# Install dependencies
RUN flutter pub get
# Build the Flutter app
RUN flutter build apk
# Expose port 8080 (or your preferred port)
EXPOSE 8080
# Start the Flutter application
CMD ["flutter", "run", "--host-vmservice-port=8080", "--no-sound-null-safety"]